Skip to content
Snippets Groups Projects
Commit ce0c2a64 authored by Martin Nilsson's avatar Martin Nilsson
Browse files

small_factor is slower than probably_prime_p with modern GMP.

parent 9c261adc
No related branches found
No related tags found
No related merge requests found
...@@ -130,7 +130,7 @@ protected array(Gmp.mpz) nist_primes(int l) ...@@ -130,7 +130,7 @@ protected array(Gmp.mpz) nist_primes(int l)
Gmp.mpz q = Gmp.mpz(h, 256); Gmp.mpz q = Gmp.mpz(h, 256);
if (q->small_factor() || !q->probably_prime_p()) if (!q->probably_prime_p())
continue; continue;
/* q is a prime, with overwelming probability. */ /* q is a prime, with overwelming probability. */
...@@ -152,7 +152,7 @@ protected array(Gmp.mpz) nist_primes(int l) ...@@ -152,7 +152,7 @@ protected array(Gmp.mpz) nist_primes(int l)
p -= p % (2 * q) - 1; p -= p % (2 * q) - 1;
if (!p->small_factor() && p->probably_prime_p()) if (p->probably_prime_p())
{ {
/* Done */ /* Done */
return ({ p, q }); return ({ p, q });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment