Interfaces to perform MAC operations in one shot. More...
Functions | |
| mcuxClMac_Status_t | mcuxClMac_compute (mcuxClSession_Handle_t session, mcuxClKey_Handle_t key, mcuxClMac_Mode_t mode, mcuxCl_InputBuffer_t pIn, uint32_t inLength, mcuxCl_Buffer_t pMac, uint32_t *const pMacLength) |
| One-shot message authentication code (MAC) computation function. | |
Interfaces to perform MAC operations in one shot.
| mcuxClMac_Status_t mcuxClMac_compute | ( | mcuxClSession_Handle_t | session, |
| mcuxClKey_Handle_t | key, | ||
| mcuxClMac_Mode_t | mode, | ||
| mcuxCl_InputBuffer_t | pIn, | ||
| uint32_t | inLength, | ||
| mcuxCl_Buffer_t | pMac, | ||
| uint32_t *const | pMacLength ) |
One-shot message authentication code (MAC) computation function.
This function performs a MAC computation in one shot. The algorithm to be used will be determined based on the key that is provided.
For example, to perform an AES MAC computation with a 128-bit key in CMAC mode on padded data, the following needs to be provided:
| [in] | session | Handle for the current CL session. |
| [in] | key | Key to be used to authenticate the data (word-aligned). |
| [in] | mode | Mode that should be used during the MAC operation. |
| [in] | pIn | Pointer to the input buffer that contains the data that needs to be authenticated. |
| [in] | inLength | Number of bytes of data in the pIn buffer. |
| [out] | pMac | Pointer to the output buffer where the MAC needs to be written. |
| [out] | pMacLength | Will be set to the number of bytes of data that have been written to the pMac buffer. |
| MCUXCLMAC_STATUS_OK | Mac operation successful |
| MCUXCLMAC_STATUS_ERROR | Error occurred during Mac operation |
| MCUXCLMAC_STATUS_INVALID_PARAM | An invalid parameter was given to the function |
| MCUXCLMAC_STATUS_FAULT_ATTACK | Fault attack detected |
| MCUXCLSGI_STATUS_UNWRAP_ERROR | Error during RFC3394 Key Unwrap detected. An SGI reset or FULL_FLUSH needs to be performed. |
| MCUXCLMAC_STATUS_JOB_STARTED | Non-blocking operation started successfully |
| MCUXCLMAC_STATUS_JOB_COMPLETED | Non-blocking operation successful |
inLength has an upper limit of 0x7fff0 bytes. Also, if the inLength is small (only a few blocks of data), this function is not guaranteed to return in a non-blocking matter, but might return after all data was already processed. The status code shall be used as an indicator, where only MCUXCLMAC_STATUS_JOB_STARTED indicates that a non-blocking operation has started.