mbedtls_cipher_cmac() function
This function calculates the full generic CMAC on the input buffer with the provided key. The function allocates the context, performs the calculation, and frees the context. The CMAC result is calculated as output = generic CMAC(cmac key, input buffer).
Arguments
cipher_info
The cipher information.
keylen
The length of the CMAC key in bits.
input
The buffer holding the input data.
ilen
The length of the input data.
output
The buffer for the generic CMAC result.
Return value
\c 0 on success. #MBEDTLS_ERR_MD_BAD_INPUT_DATA if parameter verification fails.
Notes
When the CMAC implementation is supplied by an alternate implementation (through #MBEDTLS_CMAC_ALT), some ciphers may not be supported by that implementation, and thus return an error. Alternate implementations must support AES-128 and AES-256, and may support AES-192 and 3DES.
mbedtls_cipher_cmac() is called by 2 functions and calls 6 functions:
![]()
mbedtls_cipher_cmac()
mbedtls_cipher_cmac():
![]()
mbedtls_cipher_cmac()