5.5.2.3 Crypto_Aead_AesGcm_AddAadData

crypto_Aead_Status_E Crypto_Aead_AesGcm_AddAadData(
    st_Crypto_Aead_AesGcm_ctx *ptr_aesGcmCtx_st, 
    uint8_t *ptr_aad, 
    uint32_t aadLen);

Description

This API is used to incorporate additional authentication data into an AES-GCM encrypted stream. It should be called when the user requires authentication assurance of the additional associated data (AAD). To use it, initialize the context by calling the Crypto_Aead_AesGcm_Init function, then call this API. Afterward, proceed with encrypting the data using Crypto_Aead_AesGcm_Cipher. Finally, obtain the authentication tag by calling Crypto_Aead_AesGcm_Final. If authentication assurance of AAD is not needed, you can skip calling this API.

Parameters

No.Argument TypeArgument NameTypeDescription
1st_Crypto_Aead_AesGcm_ctx*ptr_aesGcmCtx_stInputAES-GCM Algorithm context.
2uint8_t*ptr_aadInputPointer for additional authentication data. It is optional to use, so it can be NULL also.
3uint32_taadLenInputLength of additional authentication data in bytes, as it is optional so it can be 0 also.

Returns

Return TypeDescription
crypto_Aead_Status_EFunction returns the status of the API.