diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | mini-gmp.c | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +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> * 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) gmp_assert_nocarry (mpn_sub_1 (dp + limb_index, dp + limb_index, dn - limb_index, bit)); - dn -= (dp[dn-1] == 0); + dn = mpn_normalized_size (dp, dn); d->_mp_size = (d->_mp_size < 0) ? - dn : dn; } |