primegen bugfix, recalculate i

This commit is contained in:
Sanjana Rajan 2018-03-07 08:32:52 +01:00
parent dd4c05ae84
commit 354b961b67

View File

@ -57,6 +57,7 @@ async function randomProbablePrime(bits, e, k) {
// If reached the maximum, go back to the minimum.
if (n.bitLength() > bits) {
n = n.mod(min.shln(1)).iadd(min);
i = n.mod(thirty).toNumber();
}
// eslint-disable-next-line no-await-in-loop
} while (!await isProbablePrime(n, e, k));