Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion libff/algebra/fields/fp.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,8 @@ Fp_model<n, modulus> Fp_model<n,modulus>::random_element() /// returns random el
const std::size_t part = bitno/GMP_NUMB_BITS;
const std::size_t bit = bitno - (GMP_NUMB_BITS*part);

r.mont_repr.data[part] &= ~(1ul<<bit);
static const mp_limb_t one = 1;
r.mont_repr.data[part] &= ~(one<<bit);

bitno--;
}
Expand Down
3 changes: 2 additions & 1 deletion libff/algebra/fields/fp12_2over3over2.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ Fp12_2over3over2_model<n, modulus> Fp12_2over3over2_model<n,modulus>::cyclotomic
res = res.cyclotomic_squared();
}

if (exponent.data[i] & (1ul<<j))
static const mp_limb_t one = 1;
if (exponent.data[i] & (one<<j))
{
found_one = true;
res = res * (*this);
Expand Down
3 changes: 2 additions & 1 deletion libff/common/rng.tcc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ FieldT SHA512_rng(const uint64_t idx)
const std::size_t part = bitno/GMP_NUMB_BITS;
const std::size_t bit = bitno - (GMP_NUMB_BITS*part);

rval.data[part] &= ~(1ul<<bit);
static const mp_limb_t one = 1;
rval.data[part] &= ~(one<<bit);

bitno--;
}
Expand Down