xilrsa
Vitis Drivers API Documentation
XilRSA APIs and Descriptions

Functions

void rsa2048_exp (const unsigned char *base, const unsigned char *modular, const unsigned char *modular_ext, const unsigned char *exponent, unsigned char *result)
 This function is used to encrypt the data using 2048 bit private key. More...
 
void rsa2048_pubexp (RSA_NUMBER a, RSA_NUMBER x, unsigned long e, RSA_NUMBER m, RSA_NUMBER rrm)
 This function is used to decrypt the data using 2048 bit public key. More...
 
void sha_256 (const unsigned char *in, const unsigned int size, unsigned char *out)
 This function calculates the hash for the input data using SHA-256 algorithm. More...
 
void sha2_starts (sha2_context *ctx)
 This function initializes the SHA2 context. More...
 
void sha2_update (sha2_context *ctx, unsigned char *input, unsigned int ilen)
 This function adds the input data to SHA256 calculation. More...
 
void sha2_finish (sha2_context *ctx, unsigned char *output)
 This function finishes the SHA calculation. More...
 

Function Documentation

void rsa2048_exp ( const unsigned char *  base,
const unsigned char *  modular,
const unsigned char *  modular_ext,
const unsigned char *  exponent,
unsigned char *  result 
)

This function is used to encrypt the data using 2048 bit private key.

Parameters
modularA char pointer which contains the key modulus
modular_extA char pointer which contains the key modulus extension
exponentA char pointer which contains the private key exponent
resultA char pointer which contains the encrypted data
Returns
None
void rsa2048_pubexp ( RSA_NUMBER  a,
RSA_NUMBER  x,
unsigned long  e,
RSA_NUMBER  m,
RSA_NUMBER  rrm 
)

This function is used to decrypt the data using 2048 bit public key.

Parameters
aRSA_NUMBER containing the decrypted data.
xRSA_NUMBER containing the input data
eUnsigned number containing the public key exponent
mRSA_NUMBER containing the public key modulus
rrmRSA_NUMBER containing the public key modulus extension.
Returns
None
void sha2_finish ( sha2_context *  ctx,
unsigned char *  output 
)

This function finishes the SHA calculation.

Parameters
ctxPointer to sha2_context structure that stores status and buffer.
outputPointer to the calculated hash data.
Returns
None
void sha2_starts ( sha2_context *  ctx)

This function initializes the SHA2 context.

Parameters
ctxPointer to sha2_context structure that stores status and buffer.
Returns
None
void sha2_update ( sha2_context *  ctx,
unsigned char *  input,
unsigned int  ilen 
)

This function adds the input data to SHA256 calculation.

Parameters
ctxPointer to sha2_context structure that stores status and buffer.
inputPointer to the data to add.
OutLength of the input data.
Returns
None
void sha_256 ( const unsigned char *  in,
const unsigned int  size,
unsigned char *  out 
)

This function calculates the hash for the input data using SHA-256 algorithm.

This function internally calls the sha2_init, updates and finishes functions and updates the result.

Parameters
InChar pointer which contains the input data.
SizeLength of the input data
OutPointer to location where resulting hash will be written.
Returns
None