Add support for primality checking
authortb <tb@openbsd.org>
Thu, 7 Jul 2022 20:01:20 +0000 (20:01 +0000)
committertb <tb@openbsd.org>
Thu, 7 Jul 2022 20:01:20 +0000 (20:01 +0000)
commitf10885cdfe5071de91362106c0fb0b5b21ec8fa8
tree00c5c9866a6f54bdc42a3e8338b41ccc3660b76c
parent1d5ff589dc4b4b0284b505b92c9baf4d5b00eca5
Add support for primality checking

Project Wycheproof's primality_tests.json contain a set of 280 numbers
that trigger edge cases in Miller-Rabin and related checks. libcrypto's
Miller-Rabin test is known to be rather poor, hopefully we will soon see
a diff on tech that improves on this.

This extends the Go test in the usual way and also adds a perl script
that allows testing on non-Go architectures.

Deliberately not yet linked to regress since the tests are flaky with
the current BN_is_prime_ex() implementatation.
regress/lib/libcrypto/wycheproof/Makefile
regress/lib/libcrypto/wycheproof/wycheproof-json.pl [new file with mode: 0644]
regress/lib/libcrypto/wycheproof/wycheproof-primes.c [new file with mode: 0644]
regress/lib/libcrypto/wycheproof/wycheproof.go