Function esp_idf_svc::sys::mbedtls_cipher_cmac
source ยท pub unsafe extern "C" fn mbedtls_cipher_cmac(
cipher_info: *const mbedtls_cipher_info_t,
key: *const u8,
keylen: usize,
input: *const u8,
ilen: usize,
output: *mut u8,
) -> i32
Expand description
\brief 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).
\note 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.
\param cipher_info The cipher information. \param key The CMAC key. \param keylen The length of the CMAC key in bits. \param input The buffer holding the input data. \param ilen The length of the input data. \param output The buffer for the generic CMAC result.
\return \c 0 on success. \return #MBEDTLS_ERR_MD_BAD_INPUT_DATA if parameter verification fails.