MW_AES_CcmDecryptInit
C
uint16_t MW_AES_CcmDecryptInit(MW_AES_Ctx_T * p_ctx, uint8_t *p_aesKey, uint8_t *p_nonce, uint8_t nonceSz, uint8_t tagSz, uint8_t *p_aad, uint16_t aadSz, uint16_t dataSz);
Description
Initializes AES CCM decryption.
Parameters
Parameter | Description |
---|---|
[out] p_ctx | Pointer to the AES context structure. |
[in] p_aesKey | Pointer to the 16-byte encryption key. |
[in] p_nonce | Pointer to the nonce used for encryption. |
[in] nonceSz | The size of p_nonce, between 7 and 13 bytes. |
[in] tagSz | The tag size used for encryption, must be a value in {4, 6, 8, 10, 12, 14, 16}. |
[in] p_aad | Pointer to the additional authentication data. |
[in] aadSz | The size of p_aad, can be 0 if p_aad is NULL. |
[in] dataSz | The size of the data to be decrypted. |
Return values
Return value | Description |
---|---|
MBA_RES_SUCCESS | Initialization successful. |
MBA_RES_FAIL | Initialization failed. |