xilsecure
Vitis Drivers API Documentation
xsecure_plat_rsa.h File Reference

Overview

This file contains hardware interface related information for RSA device.

MODIFICATION HISTORY:
Ver   Who  Date        Changes


5.2 kpt 06/25/23 Initial release 5.3 am 09/28/23 Added wrapper function prototypes for IPCore's RSA APIs kpt 12/13/23 Added XSecure_RsaOperationParam kpt 12/13/23 Added RSA CRT support for keyunwrap 5.3 ng 01/28/24 Added SDT support ng 03/26/24 Fixed header include in SDT flow ss 04/05/24 Fixed doxygen warnings 5.4 yog 04/29/24 Fixed doxygen grouping and doxygen warnings. kpt 05/26/24 Added support RSA CRT and Expopt operation. kpt 06/13/24 Add support for RSA key generation. kpt 06/30/24 Added XSECURE_PRIME_FACTOR_MAX_P_SIZE and XSECURE_PRIME_FACTOR_MAX_Q_SIZE kal 07/24/24 Code refactoring changes for versal_2ve_2vm

 

Data Structures

struct  XSecure_RsaOaepParam
 Input and output parameters for RSA Optimal Asymmetric Encryption Padding scheme. More...
 
struct  XSecure_RsaKey
 Input parameters pointers for RSA. More...
 

Macros

#define externC   extern
 For compilation in C++. More...
 
#define XSECURE_RSA_KEY_GEN_SIZE_IN_BYTES   (XSECURE_RSA_3072_SIZE_WORDS * 4U)
 RSA default key size in bytes. More...
 
#define XSECURE_RSA_KEY_GEN_SIZE_IN_WORDS   (XSECURE_RSA_KEY_GEN_SIZE_IN_BYTES / 4U)
 RSA key generation size in words. More...
 
#define XSECURE_RSA_MAX_KEY_GEN_SUPPORT   (2U)
 Maximum keys that needs to be generated. More...
 
#define XSECURE_RSA_KEY_STATUS_WAIT   (1U)
 RSA key status wait. More...
 
#define XSECURE_RSA_2048_QUANT_SIZE   (5U)
 RSA maximum quant size for 2048 bit key. More...
 
#define XSECURE_RSA_3072_QUANT_SIZE   (2U)
 RSA maximum quant size for 3072 bit key. More...
 
#define XSECURE_RSA_4096_QUANT_SIZE   (1U)
 RSA maximum quant size for 4096 bit key. More...
 
#define XSECURE_RSA_PUBLIC_EXPONENT   (0x10001U)
 RSA public exponent value. More...
 
#define XSECURE_RSA_PUB_EXP_SIZE   (4U)
 RSA public exponent size. More...
 
#define XSECURE_KEY_PAIR_GEN_POLL_INTERVAL   (100U)
 Key pair generation poll interval. More...
 
#define XSECURE_ECDSA_RSA_SOFT_RESET   (0xF1200040U)
 ECDSA/RSA soft reset address. More...
 
#define XSECURE_RSA_SIZE_IN_BYTES   (512U)
 512 bytes for 4096 bit data More...
 
#define XSECURE_PRIME_FACTOR_P_SIZE   (XSECURE_RSA_KEY_GEN_SIZE_IN_BYTES >> 1U)
 size of first prime factor(P) More...
 
#define XSECURE_PRIME_FACTOR_Q_SIZE   (XSECURE_RSA_KEY_GEN_SIZE_IN_BYTES >> 1U)
 size of first prime factor(Q) More...
 
#define XSECURE_PRIME_FACTOR_MAX_P_SIZE   (XSECURE_RSA_SIZE_IN_BYTES >> 1U)
 256 bytes size of first prime factor(P) More...
 
#define XSECURE_PRIME_FACTOR_MAX_Q_SIZE   (XSECURE_RSA_SIZE_IN_BYTES >> 1U)
 256 bytes size of first prime factor(Q) More...
 

Enumerations

enum  XSecure_RsaKeyOpState { XSECURE_RSA_KEY_DEFAULT_STATE = 0, XSECURE_RSA_KEY_INIT_STATE, XSECURE_RSA_KEY_GEN_STATE, XSECURE_RSA_KEY_READY_STATE }
 
enum  XSecure_RsaKeyStatus { XSECURE_RSA_KEY_FREE = 0, XSECURE_RSA_KEY_AVAIL }
 

Functions

int XSecure_RsaOaepEncrypt (XSecure_Rsa *InstancePtr, XSecure_RsaOaepParam *OaepParam)
 This function encodes the given message using RSA OAEP and encrypts it. More...
 
int XSecure_RsaOaepDecrypt (XSecure_RsaPrivKey *PrivKey, XSecure_RsaOaepParam *OaepParam)
 This function decodes the given message and decrypts it using RSA OAEP. More...
 
XSecure_RsaPrivKey * XSecure_GetRsaPrivateKey (u32 RsaIdx)
 This function returns RSA private key. More...
 
XSecure_RsaPubKey * XSecure_GetRsaPublicKey (u32 RsaIdx)
 This function returns RSA public key. More...
 
u32 XSecure_GetRsaKeyInUseIdx (void)
 This function returns RSA key inuse index. More...
 
int XSecure_RsaDestroyKeyInUse (void)
 This function destroys the RSA key in use. More...
 
int XSecure_AddRsaKeyPairGenerationToScheduler (void)
 This function adds periodic task of generation RSA key pair to scheduler. More...