2025-04-28 Niels Möller <nisse@lysator.liu.se>
+ * bignum-random-prime.c (miller_rabin_pocklington): Adopt
+ mp_bitcnt_t type.
+ * ecc-mod-inv.c (ecc_mod_inv): Likewise.
+ * ecc-mul-a-eh.c (ecc_mul_a_eh): Likewise.
+ * ecc-mul-a.c (ecc_mul_a): Likewise.
+ * ecc-mul-g-eh.c (ecc_mul_g_eh): Likewise.
+ * ecc-mul-g.c (ecc_mul_g): Likewise.
+ * eccdata.c (ecc_mul_binary): Likewise.
+
* sha.h: Deleted file.
* nettle.texinfo: Delete all mention of sha.h.
* Makefile.in (HEADERS): Delete sha.h.
mpz_t y;
int is_prime = 0;
- /* Avoid the mp_bitcnt_t type for compatibility with older GMP
- versions. */
- unsigned k;
- unsigned j;
+ mp_bitcnt_t k, j;
VERBOSE(".");
#define up (scratch + 2*n)
mp_size_t n = m->size;
- /* Avoid the mp_bitcnt_t type for compatibility with older GMP
- versions. */
- unsigned i;
+ mp_bitcnt_t i;
/* Maintain
#define table (scratch + 3*ecc->p.size)
mp_limb_t *scratch_out = table + (3*ecc->p.size << ECC_MUL_A_EH_WBITS);
- /* Avoid the mp_bitcnt_t type for compatibility with older GMP
- versions. */
- unsigned blocks = (ecc->p.bit_size + ECC_MUL_A_EH_WBITS - 1) / ECC_MUL_A_EH_WBITS;
- unsigned bit_index = (blocks-1) * ECC_MUL_A_EH_WBITS;
+ mp_bitcnt_t blocks = (ecc->p.bit_size + ECC_MUL_A_EH_WBITS - 1) / ECC_MUL_A_EH_WBITS;
+ mp_bitcnt_t bit_index = (blocks-1) * ECC_MUL_A_EH_WBITS;
mp_size_t limb_index = bit_index / GMP_NUMB_BITS;
unsigned shift = bit_index % GMP_NUMB_BITS;
mp_limb_t *scratch_out = table + (3*ecc->p.size << ECC_MUL_A_WBITS);
int is_zero = 0;
- /* Avoid the mp_bitcnt_t type for compatibility with older GMP
- versions. */
- unsigned blocks = (ecc->p.bit_size + ECC_MUL_A_WBITS - 1) / ECC_MUL_A_WBITS;
- unsigned bit_index = (blocks-1) * ECC_MUL_A_WBITS;
+ mp_bitcnt_t blocks = (ecc->p.bit_size + ECC_MUL_A_WBITS - 1) / ECC_MUL_A_WBITS;
+ mp_bitcnt_t 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;
for (j = 0; j * c < bit_rows; j++)
{
unsigned bits;
- /* Avoid the mp_bitcnt_t type for compatibility with older GMP
- versions. */
- unsigned bit_index;
+ mp_bitcnt_t bit_index;
/* Extract c bits from n, stride k, starting at i + kcj,
ending at i + k (cj + c - 1)*/
for (j = 0; j * c < bit_rows; j++)
{
unsigned bits;
- /* Avoid the mp_bitcnt_t type for compatibility with older GMP
- versions. */
- unsigned bit_index;
+ mp_bitcnt_t bit_index;
int bits_is_zero;
/* Extract c bits from n, stride k, starting at i + kcj,
ecc_mul_binary (const struct ecc_curve *ecc,
struct ecc_point *r, const mpz_t n, const struct ecc_point *p)
{
- /* Avoid the mp_bitcnt_t type for compatibility with older GMP
- versions. */
- unsigned k;
+ mp_bitcnt_t k;
assert (r != p);
assert (mpz_sgn (n) > 0);