Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run unit tests against ISO/IEC 14888-2:2008 GQ test vectors #70

Merged
merged 9 commits into from
Dec 14, 2023

Conversation

johncmerfeld
Copy link
Collaborator

Closes #69

Adds specific signer/verifier tests against the values laid out in the ISO standard on which our implementation is based.

There is one painful difference between the standard and our implementation. It uses SHA-1 instead of SHAKE-256 as a hash function and uses PSS instead of PKCS15 as an encoding / format mechanism. I considered making our solution fully plug-and-play with regard to these functions. However, this incurs a huge code complexity expense because the functions in question do not share the same interface in the go standard library. Instead, I opted to turn the relevant functions into vars and rewire them at test time. This requires moving the tests from a dedicated gq_test package to the gq package.

The above is all somewhat messy and I am open to discussing alternatives. However, I believe it is the cleanest way of achieving this test coverage. The good news is that our implementation was correct on the first attempt with no modifications needed.

Copy link
Member

@jonnystoten jonnystoten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome, thanks!

Just a few minor comments below

gq/gq_iso_test.go Outdated Show resolved Hide resolved
gq/gq_iso_test.go Outdated Show resolved Hide resolved
gq/gq_iso_test.go Outdated Show resolved Hide resolved
gq/gq_iso_test.go Outdated Show resolved Hide resolved
Copy link
Member

@jonnystoten jonnystoten left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@jonnystoten jonnystoten merged commit 74cd201 into openpubkey:main Dec 14, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run unit tests against ISO/IEC 14888-2:2008 GQ test vectors
4 participants