![]() |
xilsecure
Vitis Drivers API Documentation
|
Macros | |
| #define | XSecure_AesWaitForDone(InstancePtr) |
| This macro waits for AES engine completes configured operation. More... | |
Functions | |
| s32 | XSecure_AesInitialize (XSecure_Aes *InstancePtr, XCsuDma *CsuDmaPtr, u32 KeySel, u32 *IvPtr, u32 *KeyPtr) |
| This function initializes the instance pointer. More... | |
| u32 | XSecure_AesDecryptInit (XSecure_Aes *InstancePtr, u8 *DecData, u32 Size, u8 *GcmTagAddr) |
| This function initializes the AES engine for decryption and is required to be called before calling XSecure_AesDecryptUpdate. More... | |
| s32 | XSecure_AesDecryptUpdate (XSecure_Aes *InstancePtr, u8 *EncData, u32 Size) |
| This function decrypts the encrypted data passed in and updates the GCM tag from any previous calls. More... | |
| s32 | XSecure_AesDecryptData (XSecure_Aes *InstancePtr, u8 *DecData, u8 *EncData, u32 Size, u8 *GcmTagAddr) |
| This function decrypts the encrypted data provided and updates the DecData buffer with decrypted data. More... | |
| s32 | XSecure_AesDecrypt (XSecure_Aes *InstancePtr, u8 *Dst, const u8 *Src, u32 Length) |
| This function will handle the AES-GCM Decryption. More... | |
| u32 | XSecure_AesEncryptInit (XSecure_Aes *InstancePtr, u8 *EncData, u32 Size) |
| This function is used to initialize the AES engine for encryption. More... | |
| u32 | XSecure_AesEncryptUpdate (XSecure_Aes *InstancePtr, const u8 *Data, u32 Size) |
| This function encrypts the clear-text data passed in and updates the GCM tag from any previous calls. More... | |
| u32 | XSecure_AesEncryptData (XSecure_Aes *InstancePtr, u8 *Dst, const u8 *Src, u32 Len) |
| This function encrypts Len (length) number of bytes of the passed in Src (source) buffer and stores the encrypted data along with its associated 16 byte tag in the Dst (destination) buffer. More... | |
| void | XSecure_AesReset (XSecure_Aes *InstancePtr) |
| This function sets and then clears the AES-GCM's reset line. More... | |
| #define XSecure_AesWaitForDone | ( | InstancePtr | ) |
This macro waits for AES engine completes configured operation.
| InstancePtr | Pointer to the XSecure_Aes instance. |
Referenced by XSecure_AesDecryptUpdate(), and XSecure_AesEncryptUpdate().
| s32 XSecure_AesDecrypt | ( | XSecure_Aes * | InstancePtr, |
| u8 * | Dst, | ||
| const u8 * | Src, | ||
| u32 | Length | ||
| ) |
This function will handle the AES-GCM Decryption.
| InstancePtr | Pointer to the XSecure_Aes instance. |
| Src | Pointer to encrypted data source location |
| Dst | Pointer to location where decrypted data will be written. |
| Length | Expected total length of decrypted image expected. |
References XSecure_AesKeyZero(), XSecure_AesReset(), XSECURE_CSU_AES_CFG_OFFSET, XSECURE_CSU_AES_IV_0_OFFSET, XSECURE_CSU_AES_IV_3_OFFSET, XSECURE_CSU_AES_KEY_CLR_OFFSET, XSECURE_CSU_AES_KUP_0_OFFSET, XSECURE_CSU_AES_RESET_OFFSET, XSecure_Out32, XSecure_SetReset(), and XSECURE_SSS_DMA0.
Referenced by SecureAesExample().
| s32 XSecure_AesDecryptData | ( | XSecure_Aes * | InstancePtr, |
| u8 * | DecData, | ||
| u8 * | EncData, | ||
| u32 | Size, | ||
| u8 * | GcmTagAddr | ||
| ) |
This function decrypts the encrypted data provided and updates the DecData buffer with decrypted data.
| InstancePtr | Pointer to the XSecure_Aes instance. |
| DecData | Pointer to a buffer in which decrypted data will be stored. |
| EncData | Pointer to the encrypted data which needs to be decrypted. |
| Size | Size of data to be decrypted in bytes, whereas the number of bytes should be multiples of 4. |
| Size | Size of data to be decrypted in bytes, whereas the number of bytes should be multiples of 4. |
| GcmTagAddr | Pointer to a buffer in which GCM tag address will be stored. |
References XSecure_AesDecryptInit(), and XSecure_AesDecryptUpdate().
| u32 XSecure_AesDecryptInit | ( | XSecure_Aes * | InstancePtr, |
| u8 * | DecData, | ||
| u32 | Size, | ||
| u8 * | GcmTagAddr | ||
| ) |
This function initializes the AES engine for decryption and is required to be called before calling XSecure_AesDecryptUpdate.
| InstancePtr | Pointer to the XSecure_Aes instance. |
| DecData | Pointer in which decrypted data will be stored. |
| Size | Expected size of the data in bytes whereas the number of bytes provided should be multiples of 4. |
| GcmTagAddr | Pointer to the GCM tag which needs to be verified during decryption of the data. |
References XSecure_AesKeyZero(), XSecure_AesReset(), XSECURE_CSU_AES_CFG_OFFSET, XSECURE_CSU_AES_KEY_CLR_OFFSET, XSECURE_CSU_AES_KUP_0_OFFSET, XSECURE_CSU_AES_RESET_OFFSET, XSECURE_CSU_AES_START_MSG_OFFSET, XSecure_Out32, XSecure_SetReset(), and XSECURE_SSS_DMA0.
| s32 XSecure_AesDecryptUpdate | ( | XSecure_Aes * | InstancePtr, |
| u8 * | EncData, | ||
| u32 | Size | ||
| ) |
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.
| 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. |
References XSecure_AesKeyZero(), XSecure_AesWaitForDone, XSECURE_CSU_AES_IV_3_OFFSET, XSECURE_CSU_AES_RESET_OFFSET, XSECURE_CSU_AES_STS_OFFSET, and XSecure_SetReset().
| u32 XSecure_AesEncryptData | ( | XSecure_Aes * | InstancePtr, |
| u8 * | Dst, | ||
| const u8 * | Src, | ||
| u32 | Len | ||
| ) |
This function encrypts Len (length) number of bytes of the passed in Src (source) buffer and stores the encrypted data along with its associated 16 byte tag in the Dst (destination) buffer.
| InstancePtr | A pointer to the XSecure_Aes instance. |
| Dst | A pointer to a buffer where encrypted data along with GCM tag will be stored. The Size of buffer provided should be Size of the data plus 16 bytes |
| Src | A pointer to input data for encryption. |
| Len | Size of input data in bytes, whereas the number of bytes provided should be multiples of 4. |
References XSecure_AesEncryptInit(), and XSecure_AesEncryptUpdate().
| u32 XSecure_AesEncryptInit | ( | XSecure_Aes * | InstancePtr, |
| u8 * | EncData, | ||
| u32 | Size | ||
| ) |
This function is used to initialize the AES engine for encryption.
| InstancePtr | Pointer to the XSecure_Aes instance. |
| EncData | Pointer of a buffer in which encrypted data along with GCM TAG will be stored. Buffer size should be Size of data plus 16 bytes. |
| Size | A 32 bit variable, which holds the size of the input data to be encrypted in bytes, whereas number of bytes provided should be multiples of 4. |
References XSecure_AesKeyZero(), XSecure_AesReset(), XSECURE_CSU_AES_CFG_OFFSET, XSECURE_CSU_AES_KEY_CLR_OFFSET, XSECURE_CSU_AES_KUP_0_OFFSET, XSECURE_CSU_AES_RESET_OFFSET, XSECURE_CSU_AES_START_MSG_OFFSET, XSecure_Out32, XSecure_SetReset(), and XSECURE_SSS_DMA0.
| u32 XSecure_AesEncryptUpdate | ( | XSecure_Aes * | InstancePtr, |
| const u8 * | Data, | ||
| u32 | Size | ||
| ) |
This function encrypts the clear-text data passed in and updates the GCM tag from any previous calls.
The size from XSecure_AesEncryptInit is decremented from the size passed into this function to determine when the final CSU DMA transfer of data to the AES-GCM cryptographic core.
| InstancePtr | Pointer to the XSecure_Aes instance. |
| Data | Pointer to the data for which encryption should be performed. |
| Size | A 32 bit variable, which holds the size of the input data in bytes, whereas the number of bytes provided should be multiples of 4. |
References XSecure_AesKeyZero(), XSecure_AesWaitForDone, XSECURE_CSU_AES_RESET_OFFSET, and XSecure_SetReset().
| s32 XSecure_AesInitialize | ( | XSecure_Aes * | InstancePtr, |
| XCsuDma * | CsuDmaPtr, | ||
| u32 | KeySel, | ||
| u32 * | IvPtr, | ||
| u32 * | KeyPtr | ||
| ) |
This function initializes the instance pointer.
| 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. |
References XSecure_CryptoCheck(), and XSECURE_CSU_AES_BASE.
| void XSecure_AesReset | ( | XSecure_Aes * | InstancePtr | ) |
This function sets and then clears the AES-GCM's reset line.
| InstancePtr | is a pointer to the XSecure_Aes instance. |
References XSECURE_CSU_AES_RESET_OFFSET, and XSecure_ReleaseReset().
Referenced by XSecure_AesDecrypt(), XSecure_AesDecryptInit(), and XSecure_AesEncryptInit().