SemiDrive SSDK Appication Program Interface PTG3.0
Functions
sdrv_crypto_mailbox_ske_gcm.h File Reference
#include "sdrv_crypto_mailbox_common.h"
#include "sdrv_crypto_mailbox_ske_basic.h"
#include "sdrv_crypto_mailbox_trng.h"

Go to the source code of this file.

Functions

sdrv_crypto_error_status_e cmd_ske_gcm_get_msg (uint8_t *plain, uint32_t plainlen, uint8_t *aad, uint8_t aadbytelen, uint8_t *msg, uint32_t *msgbytelen)
 
sdrv_crypto_error_status_e cmd_ske_gcm_enc (uint8_t mode, uint8_t *msg, uint32_t msgbytelen, cmd_key_type_e key_type, uint8_t *key, uint16_t key_id, uint8_t *iv, uint8_t ivbytelen, uint8_t aadbytelen, uint8_t *cipher, uint32_t tagbytelen, uint8_t *mac_buf, gcm_enc_input_ptr_t *cmd_gcm_enc_input)
 
sdrv_crypto_error_status_e cmd_ske_gcm_dec (uint8_t mode, uint8_t *cipher, uint32_t cipherbytelen, cmd_key_type_e key_type, uint8_t *key, uint16_t key_id, uint8_t *iv, uint8_t ivbytelen, uint8_t aadbytelen, uint8_t *msg, uint8_t *tag, uint32_t tagbytelen, uint8_t *mac_buf, gcm_dec_input_ptr_t *cmd_gcm_dec_input)
 

Detailed Description

Function Documentation

◆ cmd_ske_gcm_dec()

sdrv_crypto_error_status_e cmd_ske_gcm_dec ( uint8_t  mode,
uint8_t *  cipher,
uint32_t  cipherbytelen,
cmd_key_type_e  key_type,
uint8_t *  key,
uint16_t  key_id,
uint8_t *  iv,
uint8_t  ivbytelen,
uint8_t  aadbytelen,
uint8_t *  msg,
uint8_t *  tag,
uint32_t  tagbytelen,
uint8_t *  mac_buf,
gcm_dec_input_ptr_t cmd_gcm_dec_input 
)

ske gcm dec

This function ske gcm dec.

Parameters
[in]modeske mode
[in]ciphercipher buff
[in]cipherbytelencipher bytelen
[in]key_typeenc key type
[in]keyenc key buff
[in]key_idenc key id
[in]iviv buff
[in]ivbyteleniv bytelen
[in]aadbytelenaadbytelen
[out]msgout buff
[in]tagtag buff
[in]tagbytelentag bytelen
[in]mac_bufmac buff
[in]cmd_gcm_enc_inputgcm_enc_input buff
Returns
CMD_RETURN_SUCCESS or error code.

◆ cmd_ske_gcm_enc()

sdrv_crypto_error_status_e cmd_ske_gcm_enc ( uint8_t  mode,
uint8_t *  msg,
uint32_t  msgbytelen,
cmd_key_type_e  key_type,
uint8_t *  key,
uint16_t  key_id,
uint8_t *  iv,
uint8_t  ivbytelen,
uint8_t  aadbytelen,
uint8_t *  cipher,
uint32_t  tagbytelen,
uint8_t *  mac_buf,
gcm_enc_input_ptr_t cmd_gcm_enc_input 
)

ske gcm enc

This function ske gcm enc.

Parameters
[in]modeske mode
[in]msgmsg buff
[in]msgbytelenmsg bytelen
[in]key_typeenc key type
[in]keyenc key buff
[in]key_idenc key id
[in]iviv buff
[in]ivbyteleniv bytelen
[in]aadbytelenaadbytelen
[out]cipherout buff
[in]tagbytelentag bytelen
[in]mac_bufmac buff
[in]cmd_gcm_enc_inputgcm_enc_input buff
Returns
CMD_RETURN_SUCCESS or error code.

◆ cmd_ske_gcm_get_msg()

sdrv_crypto_error_status_e cmd_ske_gcm_get_msg ( uint8_t *  plain,
uint32_t  plainlen,
uint8_t *  aad,
uint8_t  aadbytelen,
uint8_t *  msg,
uint32_t *  msgbytelen 
)

ske gcm msg

This function get ske gcm msg(aad + plaintext)

Parameters
[in]plainplain buff
[in]plainlenplain bytelen
[in]aadaad buff
[in]aadbytelenaad bytelen
[out]msgmsg buff
[out]msgbytelenmsg len
Returns
CMD_RETURN_SUCCESS or error code.