PSA_AEAD_NONCE_LENGTH macro
The default nonce size for an AEAD algorithm, in bytes. This macro can be used to allocate a buffer of sufficient size to store the nonce output from #psa_aead_generate_nonce(). See also #PSA_AEAD_NONCE_MAX_SIZE. \warning This macro may evaluate its arguments multiple times or zero times, so you should not pass arguments that contain side effects.
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).
Return value
The default nonce size for the specified key type and algorithm. If the key type or AEAD algorithm is not recognized, or the parameters are incompatible, return 0.
Notes
This is not the maximum size of nonce supported as input to #psa_aead_set_nonce(), #psa_aead_encrypt() or #psa_aead_decrypt(), just the default size that is generated by #psa_aead_generate_nonce().
![]()
#define PSA_AEAD_NONCE_LENGTH(key_type, alg) \