From 9ff8d1f9639d700a4c6a48ba6638e34430841dd3 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 5 May 2020 16:00:17 +0200 Subject: [PATCH 1/4] Fix copypasta: signature -> encryption Signed-off-by: Gilles Peskine --- include/psa/crypto_sizes.h | 4 ++-- include/psa/crypto_values.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/psa/crypto_sizes.h b/include/psa/crypto_sizes.h index 1f04222c2..0d1810492 100644 --- a/include/psa/crypto_sizes.h +++ b/include/psa/crypto_sizes.h @@ -431,7 +431,7 @@ * \param key_type An asymmetric key type (this may indifferently be a * key pair type or a public key type). * \param key_bits The size of the key in bits. - * \param alg The signature algorithm. + * \param alg The asymmetric encryption algorithm. * * \return If the parameters are valid and supported, return * a buffer size in bytes that guarantees that @@ -462,7 +462,7 @@ * \param key_type An asymmetric key type (this may indifferently be a * key pair type or a public key type). * \param key_bits The size of the key in bits. - * \param alg The signature algorithm. + * \param alg The asymmetric encryption algorithm. * * \return If the parameters are valid and supported, return * a buffer size in bytes that guarantees that diff --git a/include/psa/crypto_values.h b/include/psa/crypto_values.h index baaabff1e..f0203f499 100644 --- a/include/psa/crypto_values.h +++ b/include/psa/crypto_values.h @@ -1259,7 +1259,7 @@ * #PSA_ALG_IS_HASH(\p hash_alg) is true) to use * for MGF1. * - * \return The corresponding RSA OAEP signature algorithm. + * \return The corresponding RSA OAEP encryption algorithm. * \return Unspecified if \p hash_alg is not a supported * hash algorithm. */ From 7668960e43795b10d0edab157e81049a000a2491 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 5 May 2020 16:01:22 +0200 Subject: [PATCH 2/4] Fix copypasta: ciphertext -> plaintext Signed-off-by: Gilles Peskine --- include/psa/crypto_sizes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/psa/crypto_sizes.h b/include/psa/crypto_sizes.h index 0d1810492..cc0eab4fb 100644 --- a/include/psa/crypto_sizes.h +++ b/include/psa/crypto_sizes.h @@ -450,9 +450,9 @@ /** Sufficient output buffer size for psa_asymmetric_decrypt(). * - * This macro returns a sufficient buffer size for a ciphertext produced using + * This macro returns a sufficient buffer size for a plaintext produced using * a key of the specified type and size, with the specified algorithm. - * Note that the actual size of the ciphertext may be smaller, depending + * Note that the actual size of the plaintext may be smaller, depending * on the algorithm. * * \warning This function may call its arguments multiple times or From 6cc0a204b9fa6048d13bd3e13c14abf15fbe10ea Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 5 May 2020 16:05:26 +0200 Subject: [PATCH 3/4] Terminology: prefer "asymmetric" to "public-key" Most of the documentation and some of the function names use "asymmetric", so use "asymmetric" everywhere. Mention "public-key" in key places to make the relevant functions easy to find if someone is looking for that. Signed-off-by: Gilles Peskine --- include/psa/crypto_values.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/include/psa/crypto_values.h b/include/psa/crypto_values.h index f0203f499..e80306c38 100644 --- a/include/psa/crypto_values.h +++ b/include/psa/crypto_values.h @@ -672,22 +672,24 @@ #define PSA_ALG_IS_AEAD(alg) \ (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_AEAD) -/** Whether the specified algorithm is a public-key signature algorithm. +/** Whether the specified algorithm is a asymmetric signature algorithm, + * also known as public-key signature algorithm. * * \param alg An algorithm identifier (value of type #psa_algorithm_t). * - * \return 1 if \p alg is a public-key signature algorithm, 0 otherwise. + * \return 1 if \p alg is an asymmetric signature algorithm, 0 otherwise. * This macro may return either 0 or 1 if \p alg is not a supported * algorithm identifier. */ #define PSA_ALG_IS_SIGN(alg) \ (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_SIGN) -/** Whether the specified algorithm is a public-key encryption algorithm. +/** Whether the specified algorithm is an asymmetric encryption algorithm, + * also known as public-key encryption algorithm. * * \param alg An algorithm identifier (value of type #psa_algorithm_t). * - * \return 1 if \p alg is a public-key encryption algorithm, 0 otherwise. + * \return 1 if \p alg is an asymmetric encryption algorithm, 0 otherwise. * This macro may return either 0 or 1 if \p alg is not a supported * algorithm identifier. */ @@ -1205,9 +1207,9 @@ /** Whether the specified algorithm is a hash-and-sign algorithm. * - * Hash-and-sign algorithms are public-key signature algorithms structured - * in two parts: first the calculation of a hash in a way that does not - * depend on the key, then the calculation of a signature from the + * Hash-and-sign algorithms are asymmetric (public-key) signature algorithms + * structured in two parts: first the calculation of a hash in a way that + * does not depend on the key, then the calculation of a signature from the * hash value and the key. * * \param alg An algorithm identifier (value of type #psa_algorithm_t). From 4eb05a4edd4111a3be110d82fe6c9af955c36e72 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 26 May 2020 17:07:16 +0200 Subject: [PATCH 4/4] Fix article in documentation Co-authored-by: Andrew Thoelke Signed-off-by: Gilles Peskine --- include/psa/crypto_values.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/psa/crypto_values.h b/include/psa/crypto_values.h index e80306c38..7a41b2233 100644 --- a/include/psa/crypto_values.h +++ b/include/psa/crypto_values.h @@ -672,7 +672,7 @@ #define PSA_ALG_IS_AEAD(alg) \ (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_AEAD) -/** Whether the specified algorithm is a asymmetric signature algorithm, +/** Whether the specified algorithm is an asymmetric signature algorithm, * also known as public-key signature algorithm. * * \param alg An algorithm identifier (value of type #psa_algorithm_t).