Libtropic API
SDK for the TROPIC01 secure element
Version: master (latest)
Loading...
Searching...
No Matches

◆ lt_aesgcm_encrypt()

lt_ret_t lt_aesgcm_encrypt ( void *  ctx,
const uint8_t *  iv,
const uint32_t  iv_len,
const uint8_t *  add,
const uint32_t  add_len,
const uint8_t *  plaintext,
const uint32_t  plaintext_len,
uint8_t *  ciphertext,
const uint32_t  ciphertext_len 
)
Parameters
ctxAES-GCM context structure
ivInitialization vector
iv_lenLength of the initialization vector
addAdditional data
add_lenLength of additional data
plaintextInput plaintext buffer
plaintext_lenLength of the plaintext in bytes
ciphertextOutput ciphertext buffer (data + tag will be stored here)
ciphertext_lenLength of the ciphertext buffer
Returns
LT_OK if success, otherwise returns other error code.