mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Merge pull request #5093 from SparkiDev/rsa_fermat_fix
Fix use of WC_RSA_NO_FERMAT_CHECK
This commit is contained in:
@ -743,7 +743,7 @@ int wc_CheckRsaKey(RsaKey* key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WC_RSA_NO_FERMAT_CHECK
|
#ifndef WC_RSA_NO_FERMAT_CHECK
|
||||||
/* Fermat's Factorization works when difference between p and q
|
/* Fermat's Factorization works when difference between p and q
|
||||||
* is less than (conservatively):
|
* is less than (conservatively):
|
||||||
* n^(1/4) + 32
|
* n^(1/4) + 32
|
||||||
@ -4606,7 +4606,7 @@ int wc_MakeRsaKey(RsaKey* key, int size, long e, WC_RNG* rng)
|
|||||||
if (err == MP_OKAY)
|
if (err == MP_OKAY)
|
||||||
err = _CheckProbablePrime(p, q, tmp3, size, &isPrime, rng);
|
err = _CheckProbablePrime(p, q, tmp3, size, &isPrime, rng);
|
||||||
|
|
||||||
#ifdef WC_RSA_NO_FERMAT_CHECK
|
#ifndef WC_RSA_NO_FERMAT_CHECK
|
||||||
if (err == MP_OKAY && isPrime) {
|
if (err == MP_OKAY && isPrime) {
|
||||||
/* Fermat's Factorization works when difference between p and q
|
/* Fermat's Factorization works when difference between p and q
|
||||||
* is less than (conservatively):
|
* is less than (conservatively):
|
||||||
|
Reference in New Issue
Block a user