diff options
author | Niels Möller <nisse@lysator.liu.se> | 2013-04-11 08:36:08 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2013-04-11 08:36:08 +0200 |
commit | bf587cd520729a1dfeab605d1e206a47f115393c (patch) | |
tree | b22b3e462b3d86ee1d69b4a923c28f256c6b28eb /ecc-mul-a.c | |
parent | fb709927da0c6088e80cf21fd988542e5e711866 (diff) | |
download | nettle-bf587cd520729a1dfeab605d1e206a47f115393c.tar.gz |
Replace mp_bitcnt_t by unsigned, for compatibility with older gmp versions.
Diffstat (limited to 'ecc-mul-a.c')
-rw-r--r-- | ecc-mul-a.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ecc-mul-a.c b/ecc-mul-a.c index b23bdc5d..7a537bf6 100644 --- a/ecc-mul-a.c +++ b/ecc-mul-a.c @@ -122,8 +122,10 @@ ecc_mul_a (const struct ecc_curve *ecc, mp_limb_t *scratch_out = table + (3*ecc->size << ECC_MUL_A_WBITS); int is_zero = 0; - mp_bitcnt_t blocks = (ecc->bit_size + ECC_MUL_A_WBITS - 1) / ECC_MUL_A_WBITS; - mp_bitcnt_t bit_index = (blocks-1) * ECC_MUL_A_WBITS; + /* Avoid the mp_bitcnt_t type for compatibility with older GMP + versions. */ + unsigned blocks = (ecc->bit_size + ECC_MUL_A_WBITS - 1) / ECC_MUL_A_WBITS; + unsigned bit_index = (blocks-1) * ECC_MUL_A_WBITS; mp_size_t limb_index = bit_index / GMP_NUMB_BITS; unsigned shift = bit_index % GMP_NUMB_BITS; |