summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/BN_generate_prime.3
diff options
context:
space:
mode:
authortb <>2023-05-10 12:21:55 +0000
committertb <>2023-05-10 12:21:55 +0000
commitb06ec6236f52401a06b0546ab08856db818aee02 (patch)
tree19201b080903229104292ae2352a17e8ddb4af50 /src/lib/libcrypto/man/BN_generate_prime.3
parent11d060ebfebf1118b35368fbf7d74f0777c8086e (diff)
downloadopenbsd-b06ec6236f52401a06b0546ab08856db818aee02.tar.gz
openbsd-b06ec6236f52401a06b0546ab08856db818aee02.tar.bz2
openbsd-b06ec6236f52401a06b0546ab08856db818aee02.zip
Add Miller-Rabin test for random bases to BPSW
The behavior of the BPSW primality test for numbers > 2^64 is not very well understood. While there is no known composite that passes the test, there are heuristics that indicate that there are likely infinitely many. Therefore it seems appropriate to harden the test. Having a settable number of MR rounds before doing a version of BPSW is also the approach taken by Go's primality check in math/big. This adds a new implementation of the old MR test that runs before running the strong Lucas test. I like to imagine that it's slightly cleaner code. We're effectively at about twice the cost of what we had a year ago. In addition, it adds some non-determinism in case there actually are false positives for the BPSW test. The implementation is straightforward. It could easily be tweaked to use the additional gcds in the "enhanced" MR test of FIPS 186-5, but as long as we are only going to throw away the additional info, that's not worth much. This is a first step towards incorporating some of the considerations in "A performant misuse-resistant API for Primality Testing" by Massimo and Paterson. Further work will happen in tree. In particular, there are plans to crank the number of Miller-Rabin tests considerably so as to have a guaranteed baseline. The manual will be updated shortly. positive feedback beck ok jsing
Diffstat (limited to 'src/lib/libcrypto/man/BN_generate_prime.3')
0 files changed, 0 insertions, 0 deletions