math/strongprime.c: Clamp the starting point.
authorMark Wooding <mdw@distorted.org.uk>
Thu, 11 May 2017 09:42:15 +0000 (10:42 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 14 May 2017 03:00:35 +0000 (04:00 +0100)
commite62e86d3cba40eaeb867b49167fdf2eb27db2844
tree77f46e46aa7924d058137741d813649692141169
parent540ff246b952bd91381bfe4fdfbc613983326379
math/strongprime.c: Clamp the starting point.

Now the result will be in the upper quarter of the `obvious' range, and
the product of two such values is guaranteed to have the desired number
of bits.  This saves callers from doing stupid things like trying to
clamp one of the factors by hand, which ends up significantly biasing
the second factor.  (This isn't very bad, because there's a /lot/ of
randomness in the chosen congruence class, but it's good to fix this
sort of thing.)
math/strongprime.c
math/strongprime.h