![]() |
mbed TLS
Version 2.8.0
SSL/TLS Library for the Embedded Space
|
Functions | |
int | mbedtls_rsa_deduce_primes (mbedtls_mpi const *N, mbedtls_mpi const *E, mbedtls_mpi const *D, mbedtls_mpi *P, mbedtls_mpi *Q) |
Compute RSA prime moduli P, Q from public modulus N=PQ and a pair of private and public key. More... | |
int | mbedtls_rsa_deduce_private_exponent (mbedtls_mpi const *P, mbedtls_mpi const *Q, mbedtls_mpi const *E, mbedtls_mpi *D) |
Compute RSA private exponent from prime moduli and public key. More... | |
int | mbedtls_rsa_deduce_crt (const mbedtls_mpi *P, const mbedtls_mpi *Q, const mbedtls_mpi *D, mbedtls_mpi *DP, mbedtls_mpi *DQ, mbedtls_mpi *QP) |
Generate RSA-CRT parameters. More... | |
int | mbedtls_rsa_validate_params (const mbedtls_mpi *N, const mbedtls_mpi *P, const mbedtls_mpi *Q, const mbedtls_mpi *D, const mbedtls_mpi *E, int(*f_rng)(void *, unsigned char *, size_t), void *p_rng) |
Check validity of core RSA parameters. More... | |
int | mbedtls_rsa_validate_crt (const mbedtls_mpi *P, const mbedtls_mpi *Q, const mbedtls_mpi *D, const mbedtls_mpi *DP, const mbedtls_mpi *DQ, const mbedtls_mpi *QP) |
Check validity of RSA CRT parameters. More... | |
Context-independent RSA helper functions.
int mbedtls_rsa_deduce_crt | ( | const mbedtls_mpi * | P, |
const mbedtls_mpi * | Q, | ||
const mbedtls_mpi * | D, | ||
mbedtls_mpi * | DP, | ||
mbedtls_mpi * | DQ, | ||
mbedtls_mpi * | QP | ||
) |
Generate RSA-CRT parameters.
P | First prime factor of N |
Q | Second prime factor of N |
D | RSA private exponent |
DP | Output variable for D modulo P-1 |
DQ | Output variable for D modulo Q-1 |
QP | Output variable for the modular inverse of Q modulo P. |
int mbedtls_rsa_deduce_primes | ( | mbedtls_mpi const * | N, |
mbedtls_mpi const * | E, | ||
mbedtls_mpi const * | D, | ||
mbedtls_mpi * | P, | ||
mbedtls_mpi * | Q | ||
) |
Compute RSA prime moduli P, Q from public modulus N=PQ and a pair of private and public key.
N | RSA modulus N = PQ, with P, Q to be found |
E | RSA public exponent |
D | RSA private exponent |
P | Pointer to MPI holding first prime factor of N on success |
Q | Pointer to MPI holding second prime factor of N on success |
mbedtls_rsa_validate_params
. int mbedtls_rsa_deduce_private_exponent | ( | mbedtls_mpi const * | P, |
mbedtls_mpi const * | Q, | ||
mbedtls_mpi const * | E, | ||
mbedtls_mpi * | D | ||
) |
Compute RSA private exponent from prime moduli and public key.
P | First prime factor of RSA modulus |
Q | Second prime factor of RSA modulus |
E | RSA public exponent |
D | Pointer to MPI holding the private exponent on success. |
int mbedtls_rsa_validate_crt | ( | const mbedtls_mpi * | P, |
const mbedtls_mpi * | Q, | ||
const mbedtls_mpi * | D, | ||
const mbedtls_mpi * | DP, | ||
const mbedtls_mpi * | DQ, | ||
const mbedtls_mpi * | QP | ||
) |
Check validity of RSA CRT parameters.
P | First prime factor of RSA modulus |
Q | Second prime factor of RSA modulus |
D | RSA private exponent |
DP | MPI to check for D modulo P-1 |
DQ | MPI to check for D modulo P-1 |
QP | MPI to check for the modular inverse of Q modulo P. |
MBEDTLS_ERR_RSA_KEY_CHECK_FAILED
if check failed, potentially including MBEDTLS_ERR_MPI_XXX
if some MPI calculations failed.MBEDTLS_ERR_RSA_BAD_INPUT_DATA
if insufficient data was provided to check DP, DQ or QP.int mbedtls_rsa_validate_params | ( | const mbedtls_mpi * | N, |
const mbedtls_mpi * | P, | ||
const mbedtls_mpi * | Q, | ||
const mbedtls_mpi * | D, | ||
const mbedtls_mpi * | E, | ||
int(*)(void *, unsigned char *, size_t) | f_rng, | ||
void * | p_rng | ||
) |
Check validity of core RSA parameters.
N | RSA modulus N = PQ |
P | First prime factor of N |
Q | Second prime factor of N |
D | RSA private exponent |
E | RSA public exponent |
f_rng | PRNG to be used for primality check, or NULL |
p_rng | PRNG context for f_rng, or NULL |