oreparaz / p256

ECDSA P-256 signature verification in a single C file targetting embedded use
14 stars 6 forks source link

Add NIST test vectors #3

Closed 0adb closed 3 years ago

0adb commented 3 years ago

Hey, I've made another file for test cases named test_nist.cc, with test vectors taken from NIST at this link. Included also is file nist_tests.txt, a snippet of the .rsp file from a zip folder from the said link which contains the test vectors I used and more that could be added.

However, I've run into a problem trying to run the tests. Specifically, the following appears when I try to run the unit tests. image I'm not sure if I should edit the Makefile to make it work for my setup (Windows 10, MinGW compiler) and wanted to ask if I should do that and add the Makefile to a .gitignore or if I should do something else; also, would like to ask if you could check the .cc to see if it looks alright as a start? Thanks.

oreparaz commented 3 years ago

This is fantastic, thank you Arthur! I'm going to go ahead and merge your changes 🎉. They compile nicely and they pass as expected:

build/p256_unittests && touch build/p256_unittests.timestamp
===============================================================================
All tests passed (7 assertions in 2 test cases)

This is great to increase the much needed test coverage. I only had to make very slight modifications to your branch that should be clear from the sequence of commits, let me know if you have any questions.

I'm creating issue https://github.com/oreparaz/p256/issues/4 for adding the rest of the tests from nist_tests.txt to test_nist.cc (feel free to take it!)

Re compilation in windows: let's open a new issue https://github.com/oreparaz/p256/issues/5 to deal with that. I didn't add support initially for windows but that shouldn't be too hard.

oreparaz commented 3 years ago

Fixes #2