MW_AES_AesCcmEncrypt

C

uint16_t MW_AES_AesCcmEncrypt(MW_AES_Ctx_T * p_ctx, uint16_t length, uint8_t *p_plainText, uint8_t *p_cipherText, uint8_t *p_tag);

Description

Encrypts data using AES CCM mode.

Parameters

ParameterDescription
[in] p_ctxPointer to the AES context structure.
[in] lengthThe length of the data to be encrypted. Must be a multiple of 16 bytes, except for the last data fragment.
[in] p_plainTextPointer to the buffer containing the data to be encrypted.
[out] p_chiperTextPointer to the buffer where the encrypted data will be stored.
[out] p_tagPointer to the buffer where the authentication tag will be stored.Only valid if p_plainText is the last data fragment.

Return values

Return valueDescription
MBA_RES_SUCCESSEncryption successful.
MBA_RES_FAILEncryption failed.