This function initializes the instance pointer.
Note: All the inputs are accepted in little endian format but the AES engine accepts the data in big endian format, The decryption and encryption functions in xsecure_aes handle the little endian to big endian conversion using few API's, Xil_Htonl (provided by Xilinx xil_io library) and XSecure_AesCsuDmaConfigureEndiannes for handling data endianness conversions. If higher performance is needed, users can strictly use data in big endian format and modify the xsecure_aes functions to remove the use of the Xil_Htonl and XSecure_AesCsuDmaConfigureEndiannes functions as required.
Prototype
s32 XSecure_AesInitialize(XSecure_Aes *InstancePtr, XCsuDma *CsuDmaPtr, u32 KeySel, u32 *IvPtr, u32 *KeyPtr);
Parameters
The following table lists the XSecure_AesInitialize
function arguments.
Name | Description |
---|---|
InstancePtr | Pointer to the XSecure_Aes instance. |
CsuDmaPtr | Pointer to the XCsuDma instance. |
KeySel |
Key source for decryption, can be KUP/device key
|
IvPtr | Pointer to the Initialization Vector for decryption |
KeyPtr | Pointer to Aes key in case KUP key is used. Pass Null if the device key is to be used. |
Returns
XST_SUCCESS if initialization was successful.