xilsecure
Vitis Drivers API Documentation
XilSecure RSA Client APIs

Macros

#define XSECURE_RSA_SIZE   (512U)
 512 bytes for 4096 bit data More...
 
#define XSECURE_PRIME_FACTOR_P_SIZE   (256U)
 256 bytes size of first prime factor(P) More...
 
#define XSECURE_PRIME_FACTOR_Q_SIZE   (256U)
 256 bytes size of first prime factor(Q) More...
 
#define XSECURE_RSA_SIZE   (512U)
 512 bytes for 4096 bit data More...
 

Functions

int XSecure_RsaPrivateDecrypt (XSecure_ClientInstance *InstancePtr, const u64 KeyAddr, const u64 InDataAddr, const u32 Size, const u64 OutDataAddr)
 This function sends IPI request to Perform RSA decryption with private key. More...
 
int XSecure_RsaPublicEncrypt (XSecure_ClientInstance *InstancePtr, const u64 KeyAddr, const u64 InDataAddr, const u32 Size, const u64 OutDataAddr)
 This function sends IPI request to Perform RSA encryption with public key. More...
 
int XSecure_RsaSignVerification (XSecure_ClientInstance *InstancePtr, const u64 SignAddr, const u64 HashAddr, const u32 Size)
 This function sends IPI request to Perform RSA sign verification. More...
 

Macro Definition Documentation

#define XSECURE_PRIME_FACTOR_P_SIZE   (256U)

256 bytes size of first prime factor(P)

#define XSECURE_PRIME_FACTOR_Q_SIZE   (256U)

256 bytes size of first prime factor(Q)

#define XSECURE_RSA_SIZE   (512U)

512 bytes for 4096 bit data

#define XSECURE_RSA_SIZE   (512U)

512 bytes for 4096 bit data

Function Documentation

int XSecure_RsaPrivateDecrypt ( XSecure_ClientInstance *  InstancePtr,
const u64  KeyAddr,
const u64  InDataAddr,
const u32  Size,
const u64  OutDataAddr 
)

This function sends IPI request to Perform RSA decryption with private key.

Parameters
InstancePtrPointer to the client instance
KeyAddrAddress of the Key
InDataAddrAddress of the data which has to be decrypted
SizeKey size in bytes, Input size also should be same as key size mentioned. Inputs supported are
  • XSECURE_RSA_4096_KEY_SIZE,
  • XSECURE_RSA_2048_KEY_SIZE
  • XSECURE_RSA_3072_KEY_SIZE
OutDataAddrAddress of the buffer where resultant decrypted data to be stored
Returns
  • XST_SUCCESS If the update is successful
  • XST_FAILURE If there is a failure

Perform input parameter validation on InstancePtr. Return XST_FAILURE if input parameters are invalid

Link shared memory of size RsaParams to RsaParams structure for IPI usage. Validates the size of the shared memory whether the required size is available or not.

Send an IPI request to the PLM by using the CDO command to call XSecure_RsaDecrypt API and returns the status of the IPI response.

References XSECURE_API_RSA_PRIVATE_DECRYPT, XSecure_DCacheFlushRange, and XSecure_ProcessMailbox().

Referenced by XSecure_RsaCore(), and XSecure_RsaPrivateDecryptKat().

int XSecure_RsaPublicEncrypt ( XSecure_ClientInstance *  InstancePtr,
const u64  KeyAddr,
const u64  InDataAddr,
const u32  Size,
const u64  OutDataAddr 
)

This function sends IPI request to Perform RSA encryption with public key.

Parameters
InstancePtrPointer to the client instance
KeyAddrAddress of the Key
InDataAddrAddress of the data which has to be encrypted with public key
SizeKey size in bytes, Input size also should be same as key size mentioned. Inputs supported are
  • XSECURE_RSA_4096_KEY_SIZE,
  • XSECURE_RSA_2048_KEY_SIZE
  • XSECURE_RSA_3072_KEY_SIZE
OutDataAddrAddress of the buffer where resultant decrypted data to be stored
Returns
  • XST_SUCCESS If encryption was successful
  • XST_FAILURE If there is a failure

Perform input parameter validation on InstancePtr. Return XST_FAILURE if input parameters are invalid

Link shared memory of size RsaParams to RsaParams structure for IPI usage. Validates the size of the shared memory whether the required size is available or not.

Send an IPI request to the PLM by using the CDO command to call XSecure_RsaEncrypt API and returns the status of the IPI response.

References XSECURE_API_RSA_PUBLIC_ENCRYPT, XSecure_DCacheFlushRange, and XSecure_ProcessMailbox().

Referenced by XSecure_DataAuth(), XSecure_RsaCore(), XSecure_RsaPublicEncryptKat(), and XSecure_SpkAuthentication().

int XSecure_RsaSignVerification ( XSecure_ClientInstance *  InstancePtr,
const u64  SignAddr,
const u64  HashAddr,
const u32  Size 
)

This function sends IPI request to Perform RSA sign verification.

Parameters
InstancePtrPointer to the client instance
SignAddrAddress of the buffer which holds the decrypted RSA signature.
HashAddrAddress of the HashAddr which has the hash calculated on the data to be authenticated
SizeLength of Hash used For SHA3 it should be 48 bytes
Returns
  • XST_SUCCESS If decryption was successful
  • XST_FAILURE In case of mismatch

Perform input parameter validation on InstancePtr. Return XST_FAILURE if input parameters are invalid

Link shared memory of size SignParams to SignParams structure for IPI usage. Validates the size of the shared memory whether the required size is available or not.

Send an IPI request to the PLM by using the CDO command to call XSecure_RsaSignVerify API and returns the status of the IPI response.

References XSECURE_API_RSA_SIGN_VERIFY, XSecure_DCacheFlushRange, and XSecure_ProcessMailbox().

Referenced by XSecure_DataAuth(), and XSecure_SpkAuthentication().