summaryrefslogtreecommitdiff
path: root/mini-gmp
diff options
context:
space:
mode:
authorMarco Bodrato <bodrato@mail.dm.unipi.it>2020-10-18 07:33:16 +0200
committerMarco Bodrato <bodrato@mail.dm.unipi.it>2020-10-18 07:33:16 +0200
commita3257b2eb299c4b806b6d42a92b0d8c5e52367f0 (patch)
tree233433425f32608579bfdd7ad67dd03fe6582c2c /mini-gmp
parente12263206737a66ca42dd46179d269c031b3bbab (diff)
downloadgmp-a3257b2eb299c4b806b6d42a92b0d8c5e52367f0.tar.gz
mini-gmp/mini-gmp.c: Use mpn_scan1 instead of mpz_scan1.
Diffstat (limited to 'mini-gmp')
-rw-r--r--mini-gmp/mini-gmp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mini-gmp/mini-gmp.c b/mini-gmp/mini-gmp.c
index 7e6084469..ab092adce 100644
--- a/mini-gmp/mini-gmp.c
+++ b/mini-gmp/mini-gmp.c
@@ -2723,7 +2723,7 @@ mpz_make_odd (mpz_t r)
assert (r->_mp_size > 0);
/* Count trailing zeros, equivalent to mpn_scan1, because we know that there is a 1 */
- shift = mpn_common_scan (r->_mp_d[0], 0, r->_mp_d, 0, 0);
+ shift = mpn_scan1 (r->_mp_d, 0);
mpz_tdiv_q_2exp (r, r, shift);
return shift;
@@ -3604,7 +3604,8 @@ mpz_probab_prime_p (const mpz_t n, int reps)
/* Find q and k, where q is odd and n = 1 + 2**k * q. */
mpz_abs (nm1, n);
nm1->_mp_d[0] -= 1;
- k = mpz_scan1 (nm1, 0);
+ /* Count trailing zeros, equivalent to mpn_scan1, because we know that there is a 1 */
+ k = mpn_scan1 (nm1->_mp_d, 0);
mpz_tdiv_q_2exp (q, nm1, k);
/* BPSW test */