xilsecure
Vitis Drivers API Documentation
xsecure_aesclient.h File Reference

Overview

This file Contains the client function prototypes, defines and macros for the AES hardware module.

MODIFICATION HISTORY:
Ver   Who  Date     Changes


1.0 kal 03/23/21 Initial release 4.5 kal 03/23/20 Updated file version to sync with library version har 04/14/21 Added XSecure_AesEncryptData and XSecure_AesDecryptData kpt 03/16/22 Removed IPI related code and added mailbox support 5.0 kpt 07/24/22 Moved XSecure_AesDecryptKat and XSecure_AesDecryptCMKat into xsecure_katclient.c kpt 08/19/22 Added GMAC support 5.2 mmd 07/09/23 Included header file for crypto algorithm information vss 09/21/23 Fixed doxygen warnings 5.3 vss 10/03/23 Added single API support for AES AAD and GMAC operations vss 03/04/24 Removed code redundancy for AesPerformOperation API 5.4 yog 04/29/24 Fixed doxygen grouping and doxygen warnings.

 

Macros

#define XSECURE_AES_INVALID_PARAM   (0x51U)
 Invalid Argument for AES. More...
 

Enumerations

enum  XSecure_AesKeySource {
  XSECURE_AES_BBRAM_KEY = 0, XSECURE_AES_BBRAM_RED_KEY, XSECURE_AES_BH_KEY, XSECURE_AES_BH_RED_KEY,
  XSECURE_AES_EFUSE_KEY, XSECURE_AES_EFUSE_RED_KEY, XSECURE_AES_EFUSE_USER_KEY_0, XSECURE_AES_EFUSE_USER_KEY_1,
  XSECURE_AES_EFUSE_USER_RED_KEY_0, XSECURE_AES_EFUSE_USER_RED_KEY_1, XSECURE_AES_KUP_KEY, XSECURE_AES_PUF_KEY,
  XSECURE_AES_USER_KEY_0, XSECURE_AES_USER_KEY_1, XSECURE_AES_USER_KEY_2, XSECURE_AES_USER_KEY_3,
  XSECURE_AES_USER_KEY_4, XSECURE_AES_USER_KEY_5, XSECURE_AES_USER_KEY_6, XSECURE_AES_USER_KEY_7,
  XSECURE_AES_EXPANDED_KEYS, XSECURE_AES_ALL_KEYS
}
 For selecting the Key source to AES Core. More...
 
enum  XSecure_AesKeySize { XSECURE_AES_KEY_SIZE_128 = 0, XSECURE_AES_KEY_SIZE_256 = 2, XSECURE_AES_KEY_SIZE_128 = 0, XSECURE_AES_KEY_SIZE_256 = 2 }
 For selecting the Key size to AES Core. More...
 

Functions

int XSecure_AesInitialize (XSecure_ClientInstance *InstancePtr)
 This function sends IPI request to initialize the AES engine. More...
 
int XSecure_AesEncryptInit (XSecure_ClientInstance *InstancePtr, XSecure_AesKeySource KeySrc, u32 Size, u64 IvAddr)
 This function sends IPI request to EncryptInit the AES engine. More...
 
int XSecure_AesDecryptInit (XSecure_ClientInstance *InstancePtr, XSecure_AesKeySource KeySrc, u32 Size, u64 IvAddr)
 This function sends IPI request to DecryptInit the AES engine. More...
 
int XSecure_AesUpdateAad (XSecure_ClientInstance *InstancePtr, u64 AadAddr, u32 AadSize)
 This function sends IPI request to update AAD to AES engine. More...
 
int XSecure_AesEncryptUpdate (XSecure_ClientInstance *InstancePtr, u64 InDataAddr, u64 OutDataAddr, u32 Size, u32 IsLast)
 This function sends IPI request to update the input data to AES engine for encryption. More...
 
int XSecure_AesDecryptUpdate (XSecure_ClientInstance *InstancePtr, u64 InDataAddr, u64 OutDataAddr, u32 Size, u32 IsLast)
 This function sends IPI request to update the encrypted data to AES engine for decryption. More...
 
int XSecure_AesDecryptFinal (XSecure_ClientInstance *InstancePtr, u64 GcmTagAddr)
 This function sends IPI request to verify the GcmTag provided for the data decrypted till the point. More...
 
int XSecure_AesEncryptFinal (XSecure_ClientInstance *InstancePtr, u64 GcmTagAddr)
 This function sends IPI request to update the GcmTag Addr to AES engine. More...
 
int XSecure_AesKeyZero (XSecure_ClientInstance *InstancePtr, XSecure_AesKeySource KeySrc)
 This function sends IPI request to zeroize selected AES key storage register. More...
 
int XSecure_AesWriteKey (XSecure_ClientInstance *InstancePtr, XSecure_AesKeySource KeySrc, u32 Size, u64 KeyAddr)
 This function sends IPI request to write the key provided into the specified AES key registers. More...
 
int XSecure_AesKekDecrypt (XSecure_ClientInstance *InstancePtr, u64 IvAddr, XSecure_AesKeySource DstKeySrc, XSecure_AesKeySource DecKeySrc, XSecure_AesKeySize Size)
 This function sends IPI request to decrypt the key in KEK key form. More...
 
int XSecure_AesSetDpaCm (XSecure_ClientInstance *InstancePtr, u8 DpaCmCfg)
 This function sends IPI request to enable/disable DpaCm in AES. More...
 
int XSecure_AesEncryptData (XSecure_ClientInstance *InstancePtr, XSecure_AesKeySource KeySrc, u32 KeySize, u64 IvAddr, u64 InDataAddr, u64 OutDataAddr, u32 Size, u64 GcmTagAddr)
 This function calls IPI request to encrypt a single block of data. More...
 
int XSecure_AesDecryptData (XSecure_ClientInstance *InstancePtr, XSecure_AesKeySource KeySrc, u32 KeySize, u64 IvAddr, u64 InDataAddr, u64 OutDataAddr, u32 Size, u64 GcmTagAddr)
 This function calls IPI request to decrypt a single block of data. More...
 
int XSecure_AesPerformOperation (const XSecure_ClientInstance *InstancePtr, const XSecure_AesDataBlockParams *AesDataParams)
 This function calls IPI request to encrypt/decrypt a single block of data along with update AAD/GMAC based on the user's choice. More...
 
int XSecure_AesGmacUpdateAad (XSecure_ClientInstance *InstancePtr, u64 AadAddr, u32 AadSize, u32 IsLastChunkSrc)
 This function sends IPI request to update AAD data to AES engine. More...