diff options
author | tomsmeding <tom.smeding@gmail.com> | 2016-10-10 22:52:38 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2016-10-10 22:52:38 +0200 |
commit | 5c19ba3ba7d07d1619e607b65b698e4eb65f6e0c (patch) | |
tree | b32e9a43cf48dee52d23f0c9219bfa29299fded6 /primes.cpp | |
parent | c33f462475a30ad560d0153a006796f47563d760 (diff) |
Improve comments
Diffstat (limited to 'primes.cpp')
-rw-r--r-- | primes.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -34,7 +34,7 @@ pair<Bigint,Bigint> genprimepair(Rng &rng,int nbits){ // (2^x + 2^(x-2))^2 = 2^(2x) + 2^(2x-1) + 2^(2x-4) // ergo: (2^x + lambda*2^(x-2))^2 \in [2^(2x), 2^(2x+1)), for lambda \in [0,1] // To make sure the primes "differ in length by a few digits" [RSA78], we use x1=x-2 in the first - // prime and x2-x+2 in the second + // prime and x2=x+2 in the second random prime searched int x1=nbits/2-2,x2=(nbits+1)/2+2; assert(x1+x2==nbits); return make_pair( |