From 1347a73fbe09927c7187dcfd871bbb0ce68e0ea7 Mon Sep 17 00:00:00 2001 From: mohammad1603 Date: Thu, 7 Jun 2018 01:38:45 +0300 Subject: [PATCH] fix macros documentation style. --- include/psa/crypto.h | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/include/psa/crypto.h b/include/psa/crypto.h index c45fccd4b..8e20013a2 100755 --- a/include/psa/crypto.h +++ b/include/psa/crypto.h @@ -1073,7 +1073,24 @@ psa_status_t psa_cipher_abort(psa_cipher_operation_t *operation); * @{ */ -// This macro calculates the encryption output size according to given algorithm + +/** AEAD Encrypted data size + * + * This macro calculates the encrypted data size according to given algorithm + * and plaintext_length. + * + * + * \param alg The AEAD algorithm to compute + * (\c PSA_ALG_XXX value such that + * #PSA_ALG_IS_AEAD(alg) is true). + * \param plaintext_length Size of \p plaintext in bytes. + * + * \return If the algorithm is PSA_ALG_GCM the encrypted data size is + * plaintext_length plus 16-bytes for tag. + * If the algorithm is PSA_ALG_CCM the encrypted data size is + * plaintext_length plus 16-bytes for tag. + * Otherwise return zero. + */ #define PSA_AEAD_ENCRYPT_OUTPUT_SIZE(alg, plaintext_length) \ ((alg) == PSA_ALG_GCM ? (plaintext_length) + 16 : \ (alg) == PSA_ALG_CCM ? (plaintext_length) + 16 : \ @@ -1132,7 +1149,23 @@ psa_status_t psa_aead_encrypt( psa_key_slot_t key, size_t ciphertext_size, size_t *ciphertext_length ); -// This macro calculates the decryption output size according to given algorithm +/** AEAD Decrypted data size + * + * This macro calculates the decrypted data size according to given algorithm + * and ciphertext_length. + * + * + * \param alg The AEAD algorithm to compute + * (\c PSA_ALG_XXX value such that + * #PSA_ALG_IS_AEAD(alg) is true). + * \param ciphertext_length Size of \p ciphertext in bytes. + * + * \return If the algorithm is PSA_ALG_GCM the decrypted data size is + * ciphertext_length minus 16-bytes for tag. + * If the algorithm is PSA_ALG_CCM the decrypted data size is + * ciphertext_length minus 16-bytes for tag. + * Otherwise return zero. + */ #define PSA_AEAD_DECRYPT_OUTPUT_SIZE(alg, ciphertext_length) \ ((alg) == PSA_ALG_GCM ? (ciphertext_length) - 16 : \ (alg) == PSA_ALG_CCM ? (ciphertext_length) - 16 : \