primegen bugfix, recalculate i
This commit is contained in:
parent
dd4c05ae84
commit
354b961b67
|
@ -57,6 +57,7 @@ async function randomProbablePrime(bits, e, k) {
|
||||||
// If reached the maximum, go back to the minimum.
|
// If reached the maximum, go back to the minimum.
|
||||||
if (n.bitLength() > bits) {
|
if (n.bitLength() > bits) {
|
||||||
n = n.mod(min.shln(1)).iadd(min);
|
n = n.mod(min.shln(1)).iadd(min);
|
||||||
|
i = n.mod(thirty).toNumber();
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line no-await-in-loop
|
// eslint-disable-next-line no-await-in-loop
|
||||||
} while (!await isProbablePrime(n, e, k));
|
} while (!await isProbablePrime(n, e, k));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user