This function decrypts the encrypted data provided and updates the DecData buffer with decrypted data.
Note: When using this function to decrypt data that was encrypted with XSecure_AesEncryptData, the GCM tag will be stored as the last sixteen (16) bytes of data in XSecure_AesEncryptData's Dst (destination) buffer and should be used as the GcmTagAddr's pointer.
s32 XSecure_AesDecryptData(XSecure_Aes *InstancePtr, u8 *DecData, u8 *EncData, u32 Size, u8 *GcmTagAddr);
The following table lists the
XSecure_AesDecryptData function arguments.
|Pointer to the XSecure_Aes instance.
|Pointer to a buffer in which decrypted data will be stored.
|Pointer to the encrypted data which needs to be decrypted.
|Size of data to be decrypted in bytes, whereas the number of bytes should be multiples of 4.
|Address of a buffer which should contain GCM Tag
This API returns the status of GCM tag matching.
- XSECURE_CSU_AES_GCM_TAG_MISMATCH: If GCM tag was mismatched
- XST_SUCCESS: If GCM tag was matched.