SemiDrive SSDK Appication Program Interface PTG3.0
Data Structures | Functions
sdrv_crypto_mailbox_hmac.h File Reference
#include "sdrv_crypto_mailbox_common.h"
#include "sdrv_crypto_mailbox_trng.h"

Go to the source code of this file.

Data Structures

struct  cmd_generateMAC_t
 
struct  cmd_verifyMAC_t
 

Functions

sdrv_crypto_error_status_e cmd_hmac_generate_mac (uint8_t mode, uint8_t *msg, uint32_t msg_bytes, cmd_key_type_e key_type, const uint8_t *key, uint16_t key_id, uint32_t key_bytes, uint8_t mac_bytes, uint8_t *out, uint8_t *mac_buf)
 
sdrv_crypto_error_status_e cmd_hmac_verify_mac (uint8_t mode, uint8_t *msg, uint32_t msg_bytes, cmd_key_type_e key_type, const uint8_t *key, uint16_t key_id, uint32_t key_bytes, uint8_t hmac_bytes, uint8_t *hmac, uint8_t *mac_buf)
 

Detailed Description

Function Documentation

◆ cmd_hmac_generate_mac()

sdrv_crypto_error_status_e cmd_hmac_generate_mac ( uint8_t  mode,
uint8_t *  msg,
uint32_t  msg_bytes,
cmd_key_type_e  key_type,
const uint8_t *  key,
uint16_t  key_id,
uint32_t  key_bytes,
uint8_t  mac_bytes,
uint8_t *  out,
uint8_t *  mac_buf 
)

get hmac value

This function get hmac

Parameters
[in]modehmac mode
[in]msgmsg buff
[in]msg_bytesmsg len
[in]key_typekey type
[in]keykey buff
[in]key_idkey id
[in]key_byteskey len
[in]mac_bytesmac len
[out]outmac buff
[in]mac_bufkey_id mac buf
Returns
CMD_RETURN_SUCCESS or error code.

◆ cmd_hmac_verify_mac()

sdrv_crypto_error_status_e cmd_hmac_verify_mac ( uint8_t  mode,
uint8_t *  msg,
uint32_t  msg_bytes,
cmd_key_type_e  key_type,
const uint8_t *  key,
uint16_t  key_id,
uint32_t  key_bytes,
uint8_t  hmac_bytes,
uint8_t *  hmac,
uint8_t *  mac_buf 
)

verify hmac

This function verify hmac.

Parameters
[in]modehmac mode
[in]msgmsg buff
[in]msg_bytesmsg len
[in]key_typekey type
[in]keykey buff
[in]key_idkey id
[in]key_byteskey len
[in]hmac_bytesmac len
[in]hmacmac buff
[in]mac_bufkey_id mac buf
Returns
CMD_RETURN_SUCCESS or error code.