![]() |
xilsecure
Vitis Drivers API Documentation
|
Macros | |
| #define | externC extern |
| For compilation in C++. 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_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... | |
| #define | XSECURE_RSA_PUB_EXP_SIZE (4U) |
| RSA public exponent size. More... | |
Functions | |
| int | XSecure_RsaExpCRT (u8 *Hash, u8 *P, u8 *Q, u8 *Dp, u8 *Dq, u8 *Qinv, u8 *Pub, u8 *Mod, int Len, u8 *Res) |
| This function performs the RSA exponentiation using CRT (Chinese Remainder Theorem). More... | |
| int | XSecure_RsaExp (u8 *Hash, u8 *Exp, u8 *Mod, u8 *P, u8 *Q, u8 *Pub, u8 *Tot, int Len, u8 *Res) |
| This function performs the RSA exponentiation. More... | |
| int | XSecure_RsaExpopt (u8 *Hash, u8 *Exp, u8 *Mod, u8 *RN, u8 *RRN, u8 *P, u8 *Q, u8 *Pub, u8 *Tot, int Len, u8 *Res) |
| This function perofrms the RSA exponentiation using pre-calculated modulus. More... | |
| #define externC extern |
For compilation in C++.
| #define XSECURE_ECDSA_RSA_SOFT_RESET (0xF1200040U) |
ECDSA/RSA soft reset address.
| #define XSECURE_PRIME_FACTOR_MAX_P_SIZE (XSECURE_RSA_SIZE_IN_BYTES >> 1U) |
256 bytes size of first prime factor(P)
| #define XSECURE_PRIME_FACTOR_MAX_Q_SIZE (XSECURE_RSA_SIZE_IN_BYTES >> 1U) |
256 bytes size of first prime factor(Q)
| #define XSECURE_RSA_PUB_EXP_SIZE (4U) |
RSA public exponent size.
| #define XSECURE_RSA_SIZE_IN_BYTES (512U) |
512 bytes for 4096 bit data
| int XSecure_RsaExp | ( | u8 * | Hash, |
| u8 * | Exp, | ||
| u8 * | Mod, | ||
| u8 * | P, | ||
| u8 * | Q, | ||
| u8 * | Pub, | ||
| u8 * | Tot, | ||
| int | Len, | ||
| u8 * | Res | ||
| ) |
This function performs the RSA exponentiation.
| Hash | is Hash of the exponentiation. |
| Exp | is exponent, a positive integer. |
| Mod | is public modulus (p*q), NULL is invalid param. |
| P | is first factor, a positive integer. |
| Q | is second factor, a positive integer. |
| Pub | is public exponent to protect against the fault insertions. |
| Tot | is totient, a secret value equal to (p-1)*(q-1). if NULL, calculated internally with p and q. |
| Len | is length of the full-length integer in bits. |
| Res | is result of exponentiation r = (h^e) mod n. |
Validate input parameters
Release the RSA engine from reset
Perform the RSA exponentiation
Reset the RSA engine
References XSECURE_ECDSA_RSA_SOFT_RESET, XSecure_Out32, and XSECURE_RSA_EXPONENT_INVALID_PARAM.
| int XSecure_RsaExpCRT | ( | u8 * | Hash, |
| u8 * | P, | ||
| u8 * | Q, | ||
| u8 * | Dp, | ||
| u8 * | Dq, | ||
| u8 * | Qinv, | ||
| u8 * | Pub, | ||
| u8 * | Mod, | ||
| int | Len, | ||
| u8 * | Res | ||
| ) |
This function performs the RSA exponentiation using CRT (Chinese Remainder Theorem).
| Hash | is the Hash of the exponentiation. |
| P | is first factor, a positive integer. |
| Q | is second factor, a positive integer. |
| Dp | is first factor's CRT exponent, a positive integer. |
| Dq | is second factor's CRT exponent, a positive integer. |
| Qinv | is (first) CRT coefficient, a positive integer. |
| Pub | is the public exponent to protect against the fault insertions. |
| Mod | is the public modulus (p*q), if NULL, calculated internally. |
| Len | is length of the full-length integer in bits. |
| Res | is result of exponentiation r = (h^e) mod n. |
Validate input parameters
Release the RSA engine from reset
Perform the RSA exponentiation using CRT
Reset the RSA engine
References XSECURE_ECDSA_RSA_SOFT_RESET, XSecure_Out32, and XSECURE_RSA_EXPONENT_INVALID_PARAM.
Referenced by XSecure_RsaOaepDecrypt().
| int XSecure_RsaExpopt | ( | u8 * | Hash, |
| u8 * | Exp, | ||
| u8 * | Mod, | ||
| u8 * | RN, | ||
| u8 * | RRN, | ||
| u8 * | P, | ||
| u8 * | Q, | ||
| u8 * | Pub, | ||
| u8 * | Tot, | ||
| int | Len, | ||
| u8 * | Res | ||
| ) |
This function perofrms the RSA exponentiation using pre-calculated modulus.
| Hash | is Hash of the exponentiation. |
| Exp | is exponent, a positive integer. |
| Mod | is public modulus (p*q), NULL is invalid param. |
| RN | is pre-calculated modulus RmodN |
| RRN | is pre-calculated modulus RRmodN |
| P | is first factor, a positive integer. |
| Q | is second factor, a positive integer. |
| Pub | is public exponent to protect against the fault insertions. |
| Tot | is totient, a secret value equal to (p-1)*(q-1). if NULL, calculated internally with p and q. |
| Len | is length of the full-length integer in bits. |
| Res | is result of exponentiation r = (h^e) mod n. |
Validate input parameters
Release the RSA engine from reset
Perform the RSA exponentiation with pre-calculated modulus
Reset the RSA engine
References XSECURE_ECDSA_RSA_SOFT_RESET, XSecure_Out32, and XSECURE_RSA_EXPONENT_INVALID_PARAM.