PSA_KEY_DOMAIN_PARAMETERS_SIZE macro
Safe output buffer size for psa_get_key_domain_parameters(). This macro returns a compile-time constant if its arguments are compile-time constants. \warning This function may call its arguments multiple times or zero times, so you should not pass arguments that contain side effects.
Syntax
#define PSA_KEY_DOMAIN_PARAMETERS_SIZE(key_type, key_bits) \
(PSA_KEY_TYPE_IS_RSA(key_type) ? sizeof(int) : \
PSA_KEY_TYPE_IS_DH(key_type) ? PSA_DH_KEY_DOMAIN_PARAMETERS_SIZE(key_bits) : \
PSA_KEY_TYPE_IS_DSA(key_type) ? PSA_DSA_KEY_DOMAIN_PARAMETERS_SIZE(key_bits) : \
0)
Arguments
key_type
A supported key type.
key_bits
The size of the key in bits.
Return value
If the parameters are valid and supported, return a buffer size in bytes that guarantees that psa_get_key_domain_parameters() will not fail with #PSA_ERROR_BUFFER_TOO_SMALL. If the parameters are a valid combination that is not supported by the implementation, this macro shall return either a sensible size or 0. If the parameters are not valid, the return value is unspecified.
Notes
This is an experimental extension to the interface. It may change in future versions of the library.