diff options
author | Jack Lloyd <[email protected]> | 2017-02-19 10:17:26 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-02-19 10:17:26 -0500 |
commit | be2eb624bda5fb19b0647f4ac01638b077798cf3 (patch) | |
tree | 9977270395072eae9a1a22742d8f01466fe9d1a3 /src/lib | |
parent | 18313f4ec3cddd61bf8fb7b38f5f788311b18703 (diff) | |
parent | 31a360b4335d23b0e83aba23033d556b2188d013 (diff) |
Merge GH #881 Adjust number of Miller-Rabin iterations in DSA param gen and RSA checks
Diffstat (limited to 'src/lib')
-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; |