libtropic
C library for TROPIC01 chip

◆ lt_aesgcm_decrypt()

int lt_aesgcm_decrypt ( void *  ctx,
const uint8_t *  iv,
uint32_t  iv_len,
const uint8_t *  aad,
uint32_t  aad_len,
uint8_t *  msg,
uint32_t  msg_len,
const uint8_t *  tag,
uint32_t  tag_len 
)

This function decrypts data. It expect initialized context with valid keys.

Parameters
ctxAESGCM context structure
ivThe initialisation vector
iv_lenLength of initialization vector in bytes
aadThe header buffer
aad_lenLength of header buffer in bytes
msgMessage buffer
msg_lenLength of message in bytes
tagThe tag buffer
tag_lenLength of tag buffer in bytes
Returns
LT_OK if success, otherwise returns other error code.