PSA_AEAD_ENCRYPT_OUTPUT_SIZE macro
The maximum size of the output of psa_aead_encrypt(), in bytes. If the size of the ciphertext buffer is at least this large, it is guaranteed that psa_aead_encrypt() will not fail due to an insufficient buffer size. Depending on the algorithm, the actual size of the ciphertext may be smaller. See also #PSA_AEAD_ENCRYPT_OUTPUT_MAX_SIZE(\p plaintext_length). \warning This macro may evaluate its arguments multiple times or zero times, so you should not pass arguments that contain side effects.
Syntax
#define PSA_AEAD_ENCRYPT_OUTPUT_SIZE(key_type, alg, plaintext_length) \
(PSA_AEAD_NONCE_LENGTH(key_type, alg) != 0 ? \
(plaintext_length) + PSA_ALG_AEAD_GET_TAG_LENGTH(alg) : \
0u)
Arguments
key_type
A symmetric key type that is compatible with algorithm \p alg.
alg
An AEAD algorithm (\c PSA_ALG_XXX value such that #PSA_ALG_IS_AEAD(\p alg) is true).
plaintext_length
Size of the plaintext in bytes.
Return value
The AEAD ciphertext size for the specified algorithm. If the key type or AEAD algorithm is not recognized, or the parameters are incompatible, return 0.
![]()
#define PSA_AEAD_ENCRYPT_OUTPUT_SIZE(key_type, alg, plaintext_length) \