PSoC 6 Peripheral Driver Library

General Description

Functions

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Cmac (CRYPTO_Type *base, uint8_t const *message, uint32_t messageSize, uint8_t const *key, cy_en_crypto_aes_key_length_t keyLength, uint8_t *cmac, cy_stc_crypto_aes_state_t *aesState)
 Calculates the AES Cipher-based Message Authentication Code (CMAC) on the input message with the provided key. More...
 
__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Hmac (CRYPTO_Type *base, uint8_t *hmac, uint8_t const *message, uint32_t messageSize, uint8_t const *key, uint32_t keyLength, cy_en_crypto_sha_mode_t mode)
 Performs the HMAC calculation. More...
 

Function Documentation

◆ Cy_Crypto_Core_Cmac()

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Cmac ( CRYPTO_Type *  base,
uint8_t const *  message,
uint32_t  messageSize,
uint8_t const *  key,
cy_en_crypto_aes_key_length_t  keyLength,
uint8_t *  cmac,
cy_stc_crypto_aes_state_t aesState 
)

Calculates the AES Cipher-based Message Authentication Code (CMAC) on the input message with the provided key.

Parameters
baseThe pointer to the CRYPTO instance.
messageThe pointer to the source plain text. Must be 4-byte aligned.
messageSizeThe size of the source plain text in bytes.
keyThe pointer to the encryption key. Must be 4-byte aligned.
keyLengthcy_en_crypto_aes_key_length_t
cmacThe pointer to the calculated CMAC.
aesStateThe pointer to the AES state structure allocated by the user. The user must not modify anything in this structure.
Returns
cy_en_crypto_status_t

◆ Cy_Crypto_Core_Hmac()

__STATIC_INLINE cy_en_crypto_status_t Cy_Crypto_Core_Hmac ( CRYPTO_Type *  base,
uint8_t *  hmac,
uint8_t const *  message,
uint32_t  messageSize,
uint8_t const *  key,
uint32_t  keyLength,
cy_en_crypto_sha_mode_t  mode 
)

Performs the HMAC calculation.

Parameters
baseThe pointer to the CRYPTO instance.
hmacThe pointer to the calculated HMAC. Must be 4-byte aligned.
messageThe pointer to the message whose hash value is being computed.
messageSizeThe size of the message.
keyThe pointer to the key.
keyLengthThe length of the key.
modecy_en_crypto_sha_mode_t
Returns
cy_en_crypto_status_t