forked from wolfSSL/wolfssl
Merge pull request #2358 from ejohnstown/rsa-keygen-speedup
RSA Key Generation Speedup
This commit is contained in:
@ -3749,8 +3749,10 @@ int mp_prime_is_prime_ex(mp_int* a, int t, int* result, WC_RNG* rng)
|
||||
/* do trial division */
|
||||
for (r = 0; r < FP_PRIME_SIZE; r++) {
|
||||
if (fp_mod_d(a, primes[r], &d) == MP_OKAY) {
|
||||
if (d == 0)
|
||||
ret = FP_NO;
|
||||
if (d == 0) {
|
||||
*result = FP_NO;
|
||||
return FP_OKAY;
|
||||
}
|
||||
}
|
||||
else
|
||||
return FP_VAL;
|
||||
|
Reference in New Issue
Block a user