We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 166a10b commit 523ca4bCopy full SHA for 523ca4b
src/common/rng.tcc
@@ -44,7 +44,9 @@ FieldT SHA512_rng(const uint64_t idx)
44
}
45
46
/* clear all bits higher than MSB of modulus */
47
- size_t bitno = GMP_NUMB_BITS * FieldT::num_limbs;
+ size_t bitno = GMP_NUMB_BITS * FieldT::num_limbs - 1;
48
+
49
+ /* mod is non-zero so the loop will always terminate */
50
while (FieldT::mod.test_bit(bitno) == false)
51
{
52
const std::size_t part = bitno/GMP_NUMB_BITS;
0 commit comments