diff options
Diffstat (limited to 'src/math')
-rw-r--r-- | src/math/numbertheory/make_prm.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/math/numbertheory/make_prm.cpp b/src/math/numbertheory/make_prm.cpp index 226f0c38f..b136b6d25 100644 --- a/src/math/numbertheory/make_prm.cpp +++ b/src/math/numbertheory/make_prm.cpp @@ -22,11 +22,11 @@ BigInt random_prime(RandomNumberGenerator& rng, throw Invalid_Argument("random_prime: Can't make a prime of " + to_string(bits) + " bits"); else if(bits == 2) - return ((rng.next_byte() % 1) ? 2 : 3); + return ((rng.next_byte() % 2) ? 2 : 3); else if(bits == 3) - return ((rng.next_byte() % 1) ? 5 : 7); + return ((rng.next_byte() % 2) ? 5 : 7); else if(bits == 4) - return ((rng.next_byte() % 1) ? 11 : 13); + return ((rng.next_byte() % 2) ? 11 : 13); if(coprime <= 0) throw Invalid_Argument("random_prime: coprime must be > 0"); |