Commit 954cbd3c authored by Niels Möller's avatar Niels Möller
Browse files

Fix for mini-gmp mpz_clrbit.

parent cc86df70
2014-08-26 Niels Möller <nisse@lysator.liu.se>
* mini-gmp.c (mpz_abs_sub_bit): Do full normalization, needed in
case the most significant bit is cleared.
2014-08-25 Niels Möller <nisse@lysator.liu.se> 2014-08-25 Niels Möller <nisse@lysator.liu.se>
* testsuite/ecdh-test.c (set_point): Check return value of * testsuite/ecdh-test.c (set_point): Check return value of
......
...@@ -3569,7 +3569,7 @@ mpz_abs_sub_bit (mpz_t d, mp_bitcnt_t bit_index) ...@@ -3569,7 +3569,7 @@ mpz_abs_sub_bit (mpz_t d, mp_bitcnt_t bit_index)
gmp_assert_nocarry (mpn_sub_1 (dp + limb_index, dp + limb_index, gmp_assert_nocarry (mpn_sub_1 (dp + limb_index, dp + limb_index,
dn - limb_index, bit)); dn - limb_index, bit));
dn -= (dp[dn-1] == 0); dn = mpn_normalized_size (dp, dn);
d->_mp_size = (d->_mp_size < 0) ? - dn : dn; d->_mp_size = (d->_mp_size < 0) ? - dn : dn;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment