diff options
-rw-r--r-- | src/lib/math/numbertheory/dsa_gen.cpp | 4 | ||||
-rw-r--r-- | src/lib/pubkey/rsa/rsa.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/math/numbertheory/dsa_gen.cpp b/src/lib/math/numbertheory/dsa_gen.cpp index 2f952356f..e8d620f4c 100644 --- a/src/lib/math/numbertheory/dsa_gen.cpp +++ b/src/lib/math/numbertheory/dsa_gen.cpp @@ -81,7 +81,7 @@ bool generate_dsa_primes(RandomNumberGenerator& rng, q.set_bit(qbits-1); q.set_bit(0); - if(!is_prime(q, rng)) + if(!is_prime(q, rng, 126)) return false; const size_t n = (pbits-1) / (HASH_SIZE * 8), @@ -107,7 +107,7 @@ bool generate_dsa_primes(RandomNumberGenerator& rng, p = X - (X % (2*q) - 1); - if(p.bits() == pbits && is_prime(p, rng)) + if(p.bits() == pbits && is_prime(p, rng, 126)) return true; } } diff --git a/src/lib/pubkey/rsa/rsa.cpp b/src/lib/pubkey/rsa/rsa.cpp index 46192c558..1a287473a 100644 --- a/src/lib/pubkey/rsa/rsa.cpp +++ b/src/lib/pubkey/rsa/rsa.cpp @@ -167,7 +167,7 @@ bool RSA_PrivateKey::check_key(RandomNumberGenerator& rng, bool strong) const if(m_d1 != m_d % (m_p - 1) || m_d2 != m_d % (m_q - 1) || m_c != inverse_mod(m_q, m_p)) return false; - const size_t prob = (strong) ? 56 : 12; + const size_t prob = (strong) ? 128 : 12; if(!is_prime(m_p, rng, prob) || !is_prime(m_q, rng, prob)) return false; |