summaryrefslogtreecommitdiff
path: root/mini-gmp
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2021-04-16 16:47:30 +0200
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2021-04-16 16:47:30 +0200
commitaa209cfbf7e3002e526884f79f465e88a15d0a3b (patch)
tree2dd8b2f00b650afe8c3c7029d6dcd71b08623c2c /mini-gmp
parentf2f96d21f86b0bdaa1b54e678b41383f83cf338d (diff)
downloadgmp-aa209cfbf7e3002e526884f79f465e88a15d0a3b.tar.gz
mini-gmp/mini-gmp.c (gmp_millerrabin): Don't check unlikely 0 or 1.
Diffstat (limited to 'mini-gmp')
-rw-r--r--mini-gmp/mini-gmp.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/mini-gmp/mini-gmp.c b/mini-gmp/mini-gmp.c
index 28b159752..c0b2e0192 100644
--- a/mini-gmp/mini-gmp.c
+++ b/mini-gmp/mini-gmp.c
@@ -3555,11 +3555,6 @@ gmp_millerrabin (const mpz_t n, const mpz_t nm1, mpz_t y,
mpz_powm_ui (y, y, 2, n);
if (mpz_cmp (y, nm1) == 0)
return 1;
- /* y == 1 means that the previous y was a non-trivial square root
- of 1 (mod n). y == 0 means that n is a power of the base.
- In either case, n is not prime. */
- if (mpz_cmp_ui (y, 1) <= 0)
- return 0;
}
return 0;
}