MCUX CLNS
MCUX Crypto Library Normal Secure
One-shot AEAD interfaces

Interfaces to perform AEAD operations in one shot. More...

Modules

 Multi-part AEAD interfaces
 Interfaces to perform AEAD operations in multiple parts.
 

Functions

mcuxClAead_Status_t mcuxClAead_crypt (mcuxClSession_Handle_t session, mcuxClKey_Handle_t key, mcuxClAead_Mode_t mode, mcuxCl_InputBuffer_t pNonce, uint32_t nonceLength, mcuxCl_InputBuffer_t pIn, uint32_t inLength, mcuxCl_InputBuffer_t pAdata, uint32_t adataLength, mcuxCl_Buffer_t pOut, uint32_t *const pOutLength, mcuxCl_Buffer_t pTag, uint32_t tagLength)
 One-shot authenticated encryption/decryption function. More...
 

Detailed Description

Interfaces to perform AEAD operations in one shot.

Function Documentation

◆ mcuxClAead_crypt()

mcuxClAead_Status_t mcuxClAead_crypt ( mcuxClSession_Handle_t  session,
mcuxClKey_Handle_t  key,
mcuxClAead_Mode_t  mode,
mcuxCl_InputBuffer_t  pNonce,
uint32_t  nonceLength,
mcuxCl_InputBuffer_t  pIn,
uint32_t  inLength,
mcuxCl_InputBuffer_t  pAdata,
uint32_t  adataLength,
mcuxCl_Buffer_t  pOut,
uint32_t *const  pOutLength,
mcuxCl_Buffer_t  pTag,
uint32_t  tagLength 
)

One-shot authenticated encryption/decryption function.

This function performs an authenticated encryption/decryption operation in one shot. The algorithm to be used will be determined based on the mode that is provided.

For example, to perform an AES authenticated encryption operation with a 128-bit key in GCM mode on padded data, the following needs to be provided:

  • AES128 key
  • AES GCM encryption mode
  • Nonce
  • Plain input data
  • Associated data
  • Output data buffer
  • Output length buffer, to store the amount of written bytes
  • Tag buffer, to store the authentication tag
Parameters
sessionHandle for the current CL session.
keyKey to be used to encrypt the data.
modeAEAD mode that should be used during the encryption operation.
[in]pNoncePointer to the buffer that contains the nonce.
nonceLengthNumber of bytes of nonce data in the nonce buffer.
[in]pInPointer to the input buffer that contains the plain data that need to be authenticated and encrypted.
inLengthNumber of bytes of plain data in the in buffer.
[in]pAdataAssociated data for the authenticated encryption operation. Data format depends on the chosen mode.
adataLengthNumber of bytes of associated data in the adata buffer.
[out]pOutPointer to the output buffer where the authenticated encrypted data needs to be written.
[out]pOutLengthWill be incremented by the number of bytes of authenticated encrypted data that have been written to the out buffer.
[out]pTagPointer to the output buffer where the tag needs to be written.
tagLengthNumber of bytes of tag data that will be written to the tag buffer.
Returns
status