MW_AES_AesCcmEncrypt
PIC32CX-BZ2
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
| Parameter | Description |
|---|---|
| [in] p_ctx | Pointer to the AES context structure. |
| [in] length | The length of the data to be encrypted. Must be a multiple of 16 bytes, except for the last data fragment. |
| [in] p_plainText | Pointer to the buffer containing the data to be encrypted. |
| [out] p_cipherText | Pointer to the buffer where the encrypted data will be stored. |
| [out] p_tag | Pointer to the buffer where the authentication tag will be stored.Only valid if p_plainText is the last data fragment. |
Return values
| Return value | Description |
|---|---|
| MBA_RES_SUCCESS | Encryption successful. |
| MBA_RES_FAIL | Encryption failed. |
| MBA_RES_AUTHENTICATION_FAILURE | Authentication failed. |
| MBA_RES_INVALID_PARA | Invalid parameter input. |
PIC32CX-BZ3 and PIC32CX-BZ6
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
| Parameter | Description |
|---|---|
| [in] p_ctx | Pointer to the AES context structure. |
| [in] length | The length of the data to be encrypted. Must be a multiple of 16 bytes, except for the last data fragment. |
| [in] p_plainText | Pointer to the buffer containing the data to be encrypted. |
| [out] p_cipherText | Pointer to the buffer where the encrypted data will be stored. |
| [out] p_tag | Pointer to the buffer where the authentication tag will be stored.Only valid if p_plainText is the last data fragment. |
Return values
| Return value | Description |
|---|---|
| MBA_RES_SUCCESS | Encryption successful. |
| MBA_RES_FAIL | Encryption failed. |
