chiark / gitweb /
math/, pub/: Generate primes with exactly the right size.
Previously, the `strongprime' and `limlee' machinery had a tendency to
generate primes which were a few bits shorter than actually requested.
Fix this unfortunate state of affairs by using a more careful analysis
of sizes of things.
The Lim--Lee prime generation has been changed quite a bit. The large
factor now might not be suitable, so there's some new machinery for
tracking how useful it's being for generating numbers of the right size
and choosing a different one if it gets out of whack. Unfortunately,
this means applying a rather unpleasant hack to the structure layout to
preserve ABI compatibility.