MCUX CLNS MCUX Crypto Library Normal Secure |

Functions
mcuxClCss_Hmac_Functions
mcuxClCss » mcuxClCss_Hmac

Defines all functions of mcuxClCss_Hmac. More...

## Functions
MCUXCLCSS_API mcuxClCss_Status_Protected_t | mcuxClCss_Hmac_Async (mcuxClCss_HmacOption_t options, mcuxClCss_KeyIndex_t keyIdx, uint8_t const *pPaddedKey, uint8_t const *pInput, size_t inputLength, uint8_t *pOutput)
| Performs HMAC with SHA-256. More...

## Detailed Description

Defines all functions of mcuxClCss_Hmac.

## Function Documentation

## ◆ mcuxClCss_Hmac_Async()

MCUXCLCSS_API mcuxClCss_Status_Protected_t mcuxClCss_Hmac_Async | ( | mcuxClCss_HmacOption_t | options,
|  | mcuxClCss_KeyIndex_t | keyIdx,
|  | uint8_t const * | pPaddedKey,
|  | uint8_t const * | pInput,
|  | size_t | inputLength,
|  | uint8_t * | pOutput
| ) |  |

Performs HMAC with SHA-256.

Call mcuxClCss_WaitForOperation to complete the operation.

Parameters

  [in] | options | The command options. For more information, see mcuxClCss_HmacOption_t.
  [in] | keyIdx | The HMAC key index, if an internal key shall be used
  [in] | pPaddedKey | Pointer to a memory location containing the padded HMAC key
  [in] | pInput | Pointer to a memory location which contains the data to be authenticated
  [in] | inputLength | Size of `pInput` in bytes
  [out] | pOutput | The output message authentication code

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

Parameter properties
  `options.extkey` == MCUXCLCSS_HMAC_EXTERNAL_KEY_ENABLE

    `keyIdx` is ignored.

    `pPaddedKey` must contain the padded HMAC key, which can mean one of two things depending on the length of the original HMAC key, LkHMAC:

    - If LkHMAC ≤ MCUXCLCSS_HMAC_PADDED_KEY_SIZE, `pPaddedKey` must be the HMAC key padded with zero-bytes to fill the required length of MCUXCLCSS_HMAC_PADDED_KEY_SIZE bytes.

    - If LkHMAC > MCUXCLCSS_HMAC_PADDED_KEY_SIZE, `pPaddedKey` must contain the SHA-256 hash of the HMAC key, padded with zero-bytes to fill the required length of MCUXCLCSS_HMAC_PADDED_KEY_SIZE bytes.

  `options.extkey` == MCUXCLCSS_HMAC_EXTERNAL_KEY_DISABLE

    `keyIdx` must be a valid key index with the correct usage rights for HMAC.

    `pPaddedKey` 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_PARAM | if an invalid parameter was specified
  MCUXCLCSS_STATUS_SW_CANNOT_INTERRUPT | if a running operation prevented the request
  MCUXCLCSS_STATUS_OK_WAIT | on successful request