From ce0c2a640e126291af9fb79915bc53d7a5a62b50 Mon Sep 17 00:00:00 2001 From: Martin Nilsson <nilsson@opera.com> Date: Mon, 5 May 2014 11:46:52 +0200 Subject: [PATCH] small_factor is slower than probably_prime_p with modern GMP. --- lib/modules/Crypto.pmod/DSA.pike | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/modules/Crypto.pmod/DSA.pike b/lib/modules/Crypto.pmod/DSA.pike index 5855464d22..c8239ec71c 100644 --- a/lib/modules/Crypto.pmod/DSA.pike +++ b/lib/modules/Crypto.pmod/DSA.pike @@ -130,7 +130,7 @@ protected array(Gmp.mpz) nist_primes(int l) Gmp.mpz q = Gmp.mpz(h, 256); - if (q->small_factor() || !q->probably_prime_p()) + if (!q->probably_prime_p()) continue; /* q is a prime, with overwelming probability. */ @@ -152,7 +152,7 @@ protected array(Gmp.mpz) nist_primes(int l) p -= p % (2 * q) - 1; - if (!p->small_factor() && p->probably_prime_p()) + if (p->probably_prime_p()) { /* Done */ return ({ p, q }); -- GitLab