aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/math/numbertheory/make_prm.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/math/numbertheory/make_prm.cpp b/src/math/numbertheory/make_prm.cpp
index b136b6d25..61d42634a 100644
--- a/src/math/numbertheory/make_prm.cpp
+++ b/src/math/numbertheory/make_prm.cpp
@@ -38,6 +38,9 @@ BigInt random_prime(RandomNumberGenerator& rng,
while(true)
{
BigInt p(rng, bits);
+
+ // Force lowest and two top bits on
+ p.set_bit(bits - 1);
p.set_bit(bits - 2);
p.set_bit(0);