MW_AES_AesCcmDecrypt
PIC32CX-BZ2
C
uint16_t MW_AES_AesCcmDecrypt(MW_AES_Ctx_T * p_ctx, uint16_t length, uint8_t *p_cipherText, uint8_t *p_tag, uint8_t *p_plainText);Description
Decrypts 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 decrypted. Must be a multiple of 16 bytes, except for the last data fragment. |
| [in] p_chiperText | Pointer to the buffer containing the data to be decrypted. |
| [in] p_tag | Pointer to the buffer containing the authentication tag.Only be used if p_chiperText is the last data fragment. |
| [out] p_plainText | Pointer to the buffer where the decrypted data will be stored. |
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_AesCcmDecrypt(MW_AES_Ctx_T * p_ctx, uint16_t length, uint8_t *p_cipherText, uint8_t *p_tag, uint8_t *p_plainText);Description
Decrypts 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 decrypted. Must be a multiple of 16 bytes, except for the last data fragment. |
| [in] p_chiperText | Pointer to the buffer containing the data to be decrypted. |
| [in] p_tag | Pointer to the buffer containing the authentication tag.Only be used if p_chiperText is the last data fragment. |
| [out] p_plainText | Pointer to the buffer where the decrypted data will be stored. |
Return values
| Return value | Description |
|---|---|
| MBA_RES_SUCCESS | Encryption successful. |
| MBA_RES_FAIL | Encryption failed. |
