PSA_CIPHER_FINISH_OUTPUT_SIZE macro
A sufficient ciphertext buffer size for psa_cipher_finish(). If the size of the ciphertext buffer is at least this large, it is guaranteed that psa_cipher_finish() will not fail due to an insufficient ciphertext buffer size. The actual size of the output might be smaller in any given call. See also #PSA_CIPHER_FINISH_OUTPUT_MAX_SIZE().
Syntax
#define PSA_CIPHER_FINISH_OUTPUT_SIZE(key_type, alg) \
(PSA_ALG_IS_CIPHER(alg) ? \
(alg == PSA_ALG_CBC_PKCS7 ? \
PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type) : \
0u) : \
0u)
Arguments
key_type
A symmetric key type that is compatible with algorithm alg.
alg
A cipher algorithm (PSA_ALG_XXX value such that #PSA_ALG_IS_CIPHER(\p alg) is true).
Return value
A sufficient output size for the specified key type and algorithm. If the key type or cipher algorithm is not recognized, or the parameters are incompatible, return 0.
![]()
#define PSA_CIPHER_FINISH_OUTPUT_SIZE(key_type, alg) \