MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Ltc_driver_cmac_with_dpa

Overview

Functions

status_t LTC_CMAC_InitDPA (LTC_Type *base, ltc_dpa_handle_t *handle, ltc_dpa_hash_algo_t algo, const uint8_t *key, size_t keySize)
 Initialize CMAC context. More...
 
status_t LTC_CMAC_UpdateDPA (LTC_Type *base, ltc_dpa_handle_t *handle, const uint8_t *message, size_t messageSize)
 Add data to current CMAC. More...
 
status_t LTC_CMAC_FinishDPA (LTC_Type *base, ltc_dpa_handle_t *handle, uint8_t *output, size_t *outputSize)
 Finalize hashing. More...
 
status_t LTC_CMAC_DPA (LTC_Type *base, ltc_dpa_handle_t *handle, ltc_dpa_hash_algo_t algo, const uint8_t *input, size_t inputSize, const uint8_t *key, size_t keySize, uint8_t *output, size_t *outputSize)
 Create CMAC on given data. More...
 

Function Documentation

status_t LTC_CMAC_InitDPA ( LTC_Type *  base,
ltc_dpa_handle_t handle,
ltc_dpa_hash_algo_t  algo,
const uint8_t *  key,
size_t  keySize 
)

This function initialize the CMAC. Key shall be supplied because the underlaying algoritm is AES XCBC-MAC or AES CMAC.

For XCBC-MAC, the key length must be 16. For CMAC, the key length can be the AES key lengths supported by AES engine.

Parameters
baseLTC peripheral base address
handlepointer to ltc_dpa_handle_t structure which stores the transaction state.
algoUnderlaying algorithm to use for hash computation.
keyInput key (NULL if underlaying algorithm is SHA)
keySizeSize of input key in bytes
Returns
Status of initialization
status_t LTC_CMAC_UpdateDPA ( LTC_Type *  base,
ltc_dpa_handle_t handle,
const uint8_t *  message,
size_t  messageSize 
)

Add data to current CMAC. This can be called repeatedly with an arbitrary amount of data to be hashed.

Parameters
handlepointer to ltc_dpa_handle_t structure which stores the transaction state.
messageInput data
messageSizeSize of input data in bytes
Returns
Status of the hash update operation
status_t LTC_CMAC_FinishDPA ( LTC_Type *  base,
ltc_dpa_handle_t handle,
uint8_t *  output,
size_t *  outputSize 
)

Outputs the final hash and erases the context.

Parameters
handlepointer to ltc_dpa_handle_t structure which stores the transaction state.
[out]outputOutput hash data
[out]outputSizeOutput parameter storing the size of the output hash in bytes
Returns
Status of the hash finish operation
status_t LTC_CMAC_DPA ( LTC_Type *  base,
ltc_dpa_handle_t handle,
ltc_dpa_hash_algo_t  algo,
const uint8_t *  input,
size_t  inputSize,
const uint8_t *  key,
size_t  keySize,
uint8_t *  output,
size_t *  outputSize 
)

Perform the full keyed CMAC in one function call.

Parameters
baseLTC peripheral base address
handlepointer to ltc_dpa_handle_t structure which stores the transaction state.
algoBlock cipher algorithm to use for CMAC creation
inputInput data
inputSizeSize of input data in bytes
keyInput key
keySizeSize of input key in bytes
[out]outputOutput hash data
[out]outputSizeOutput parameter storing the size of the output hash in bytes
Returns
Status of the one call hash operation.