[openssl-dev] File-based bntest

David Benjamin davidben at google.com
Wed Jul 13 06:19:22 UTC 2016


Hi folks,

We recently rewrote bntest to take a test vector file rather than
generating random numbers and checking by piping to bc. I figured I'd send
a pointer your way in case you were interested in this. It takes a lot less
effort to add a new test case and is easier to run on, say, a phone where
perl and bc may not be readily available.

The BN calling code is probably not very useful to you as it's all C++ and
uses our FileTest framework. But the test vectors are below, as well as a
Go tool to validate them.
https://boringssl.googlesource.com/boringssl/+/master/crypto/bn/bn_test.cc
https://boringssl.googlesource.com/boringssl/+/master/crypto/bn/bn_tests.txt
https://boringssl.googlesource.com/boringssl/+/master/crypto/bn/check_bn_tests.go

The vectors themselves are more-or-less just taken from a run of bntest,
though I did add carry tests for BN_add, etc. I'm sure there's room for
other interesting cases.

Hope this is useful,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-dev/attachments/20160713/52740cce/attachment.html>


More information about the openssl-dev mailing list