6.3.2.2 Crypto_Mac_AesCmac_Cipher

crypto_Mac_Status_E Crypto_Mac_AesCmac_Cipher(
    st_Crypto_Mac_Aes_ctx *ptr_aesCmacCtx_st, 
    uint8_t *ptr_inputData, 
    uint32_t dataLen
    );

Description

This API executes the AES-CMAC operation to compute the Message Authentication Code (MAC). To use this API, first, initialize the context by calling the Crypto_Mac_AesCmac_Init function. Then, invoke this API. Finally, obtain the MAC by calling the Crypto_Mac_AesCmac_Final function.

Parameters

No.Argument TypeArgument NameTypeDescription
1st_Crypto_Mac_Aes_ctx*ptr_aesCmacCtx_stInputAES-CMAC algorithm context
2uint8_t*ptr_inputDataInputInput data to calculate the MAC
3uint32_tdataLenInputInput length of plain data in bytes

Returns

Return TypeDescription
crypto_Mac_Status_EFunction returns the status of the API.

Prerequisites

  • To use the HW handler, the algorithm must be enabled in Crypto v4 in MPLAB® Code Configurator.
  • To use the SW handler, the algorithm must be enabled in wolfCrypt, and linked to Crypto V4 in MPLAB® Code Configurator.
  • Crypto_Mac_AesGmac_Init must be called before calling Crypto_Mac_AesGmac_Update.

Example

Example provided in Crypto_Mac_AesGmac_Final.