MCUX CLNS
MCUX Crypto Library Normal Secure
mcuxClCss_Cmac_Functions

Defines all functions of mcuxClCss_Cmac. More...

Functions

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Cmac_Async (mcuxClCss_CmacOption_t options, mcuxClCss_KeyIndex_t keyIdx, uint8_t const *pKey, size_t keyLength, uint8_t const *pInput, size_t inputLength, uint8_t *pMac)
 Performs CMAC with AES-128 or AES-256. More...
 

Detailed Description

Defines all functions of mcuxClCss_Cmac.

Function Documentation

◆ mcuxClCss_Cmac_Async()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Cmac_Async ( mcuxClCss_CmacOption_t  options,
mcuxClCss_KeyIndex_t  keyIdx,
uint8_t const *  pKey,
size_t  keyLength,
uint8_t const *  pInput,
size_t  inputLength,
uint8_t *  pMac 
)

Performs CMAC with AES-128 or AES-256.

Call mcuxClCss_WaitForOperation to complete the operation.

Parameters
[in]optionsThe command options. For more information, see mcuxClCss_CmacOption_t.
[in]keyIdxThe CMAC key index
[in]pKeyPointer to the padded CMAC key
[in]keyLengthSize of pKey in bytes. Must be a valid CMAC key size. See the parameter properties section in the function description.
[in]pInputPointer to a memory location which contains the data, padded via SP 800-38b standard, to be authenticated
[in]inputLengthSize of pInput in bytes before padding
[in,out]pMacPointer to the CMAC command state input/output. See the parameter properties section in the function description.

The properties of some parameters change with respect to selected options.

Parameter properties
options.extkey == MCUXCLCSS_CMAC_EXTERNAL_KEY_ENABLE

keyIdx is ignored.

options.extkey == MCUXCLCSS_CMAC_EXTERNAL_KEY_DISABLE

pKey is ignored.

keyLength is ignored.

(options.finalize == MCUXCLCSS_CMAC_FINALIZE_DISABLE) && (options.soe == MCUXCLCSS_CMAC_STATE_OUT_ENABLE)

The intermediate state is written to pMac.

options.finalize == MCUXCLCSS_CMAC_FINALIZE_ENABLE

The resulting MAC is written to pMac.

options.soe is ignored.

Returns
An error code that can be any error code in MCUXCLCSS_STATUS_, see individual documentation for more information
Return values
MCUXCLCSS_STATUS_SW_INVALID_PARAMif an invalid parameter was specified
MCUXCLCSS_STATUS_SW_CANNOT_INTERRUPTif a running operation prevented the request
MCUXCLCSS_STATUS_OK_WAITon successful request