XSecure_AesDecryptUpdate - 2021.1 English

Xilinx Standalone Library Documentation OS and Libraries Document Collection (UG643)

Document ID
UG643
Release Date
2021-06-16
Version
2021.1 English

This function decrypts the encrypted data passed in and updates the GCM tag from any previous calls. The size from XSecure_AesDecryptInit is decremented from the size passed into this function to determine when the GCM tag passed to XSecure_AesDecryptInit needs to be compared to the GCM tag calculated in the AES engine.

Note: When Size of the data equals to size of the remaining data that data will be treated as final data. This API can be called multpile times but sum of all Sizes should be equal to Size mention in init. Return of the final call of this API tells whether GCM tag is matching or not.

Prototype

s32 XSecure_AesDecryptUpdate(XSecure_Aes *InstancePtr, u8 *EncData, u32 Size);

Parameters

The following table lists the XSecure_AesDecryptUpdate function arguments.

Table 1. XSecure_AesDecryptUpdate Arguments
Name Description
InstancePtr Pointer to the XSecure_Aes instance.
EncData Pointer to the encrypted data which needs to be decrypted.
Size Expected size of data to be decrypted in bytes, whereas the number of bytes should be multiples of 4.

Returns

Final call of this API returns the status of GCM tag matching.
  • XSECURE_CSU_AES_GCM_TAG_MISMATCH: If GCM tag is mismatched
  • XSECURE_CSU_AES_ZEROIZATION_ERROR: If GCM tag is mismatched, zeroize the decrypted data and send the status of zeroization.
  • XST_SUCCESS: If GCM tag is matching.