PSA_ALG_TRUNCATED_MAC macro
Macro to build a truncated MAC algorithm. A truncated MAC algorithm is identical to the corresponding MAC algorithm except that the MAC value for the truncated algorithm consists of only the first \p mac_length bytes of the MAC value for the untruncated algorithm.
Arguments
mac_alg
A MAC algorithm identifier (value of type #psa_algorithm_t such that #PSA_ALG_IS_MAC(\p mac_alg) is true). This may be a truncated or untruncated MAC algorithm.
mac_length
Desired length of the truncated MAC in bytes. This must be at most the full length of the MAC and must be at least an implementation-specified minimum. The implementation-specified minimum shall not be zero.
Return value
The corresponding MAC algorithm with the specified length. Unspecified if \p mac_alg is not a supported MAC algorithm or if \p mac_length is too small or too large for the specified MAC algorithm.
Notes
This macro may allow constructing algorithm identifiers that are not valid, either because the specified length is larger than the untruncated MAC or because the specified length is smaller than permitted by the implementation. It is implementation-defined whether a truncated MAC that is truncated to the same length as the MAC of the untruncated algorithm is considered identical to the untruncated algorithm for policy comparison purposes.