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

Na stateful macro #1687

Merged
merged 5 commits into from
Feb 8, 2024
Merged

Na stateful macro #1687

merged 5 commits into from
Feb 8, 2024

Conversation

ashman-p
Copy link
Contributor

@ashman-p ashman-p commented Feb 6, 2024

The Stateful Hash-Based Signature feature, when enabled, does signature verification by default. In this mode it uses the OQS_SIG API and only populates the 'verify' vector function. In the experimental full mode (verify, key and signature generation) use of OQS_SIG_STFL is needed.
Also, this PR includes code refactored to use macros to generate repetitive functions for HBS variants.

  • Does this PR change the input/output behaviour of a cryptographic algorithm (i.e., does it change known answer test values)? (If so, a version bump will be required from x.y.z to x.(y+1).0.)
  • Does this PR change the list of algorithms available -- either adding, removing, or renaming? Does this PR otherwise change an API? (If so, PRs in fully supported downstream projects dependent on these, i.e., oqs-provider and OQS-OpenSSH will also need to be ready for review and merge by the time this is merged.)

Copy link
Member

@baentsch baentsch left a comment

Choose a reason for hiding this comment

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

Excellent -- Thanks very much! This reduces the LOC count markedly and makes this code much more maintainable. Only nit: Do I understand it right that only a single alg gets tested? No longer too much of an issue as all of them now share the same code base, though.

@ashman-p
Copy link
Contributor Author

ashman-p commented Feb 6, 2024

Excellent -- Thanks very much! This reduces the LOC count markedly and makes this code much more maintainable. Only nit: Do I understand it right that only a single alg gets tested? No longer too much of an issue as all of them now share the same code base, though.

Thanks @baentsch.
I may have missed it but, what do you mean "single algorithm gets tested"?
My expectation is that all the enabled HBS variants would be tested.
tests/KATs/sig_stfl/kats.json

@baentsch
Copy link
Member

baentsch commented Feb 6, 2024

I may have missed it but, what do you mean "single algorithm gets tested"?
My expectation is that all the enabled HBS variants would be tested.
tests/KATs/sig_stfl/kats.json

Oops -- I may have "jumped to conclusions" (in case you know the film Office Space :): I only looked at the file diffs and saw a single test listed -- but on second view, it's not impacted, so indeed, the full alg suite may be subject to testing. I tried to validate that, but I'm hard pressed to find CI runs not skipping the algs: Could you please help me by pointing to them? I'd be particularly interested to see tests doing the verification only (using OQS_SIG) and others doing the full monty. Finally, one more suggestion to make the main "sig-stateful" code base more easily readable: Comments re-stating the macro name on closing "#endif" instructions may be helpful (at least to me) understanding which code should be running under which config.

@ashman-p
Copy link
Contributor Author

ashman-p commented Feb 6, 2024

The example that makes the most sense is the KATs used for verification tests.
e.g. python3 tests/test_kat.py

@baentsch
Copy link
Member

baentsch commented Feb 7, 2024

The example that makes the most sense is the KATs used for verification tests. e.g. python3 tests/test_kat.py

Thanks for this pointer to the test code. Open question remaining: Which CI runs do not skip these tests? Which CI runs trigger only verification, which ones keygen+sign+verify?

@ashman-p ashman-p merged commit 0a44a25 into stateful-sigs Feb 8, 2024
52 checks passed
@ashman-p ashman-p deleted the na-stateful-macro branch February 8, 2024 19:09
SWilson4 pushed a commit that referenced this pull request Feb 14, 2024
* Use OQS_SIG data struct for verify only capability.

Refactor code via macro

* Fix format issues

* Fix build error

* Fix build error

* Remove comments
cothan pushed a commit that referenced this pull request Apr 2, 2024
* Use OQS_SIG data struct for verify only capability.

Refactor code via macro

* Fix format issues

* Fix build error

* Fix build error

* Remove comments
SWilson4 pushed a commit that referenced this pull request Apr 12, 2024
* Use OQS_SIG data struct for verify only capability.

Refactor code via macro

* Fix format issues

* Fix build error

* Fix build error

* Remove comments
SWilson4 pushed a commit that referenced this pull request Apr 12, 2024
* Use OQS_SIG data struct for verify only capability.

Refactor code via macro

* Fix format issues

* Fix build error

* Fix build error

* Remove comments
SWilson4 pushed a commit that referenced this pull request Apr 12, 2024
* Use OQS_SIG data struct for verify only capability.

Refactor code via macro

* Fix format issues

* Fix build error

* Fix build error

* Remove comments
SWilson4 pushed a commit that referenced this pull request May 14, 2024
* Use OQS_SIG data struct for verify only capability.

Refactor code via macro

* Fix format issues

* Fix build error

* Fix build error

* Remove comments
ashman-p added a commit that referenced this pull request Jun 4, 2024
commit e356ebf Na lms (#1486)
commit 55094c3 LMS H5_W1 (#1513)
commit 4d773d7 Convert to use OQS_SIG_STFL_SECRET_KEY struct  (#1525)
commit 245aede LMS updated to use new SK API (#1533)
commit a85a9aa Stateful sigs secret key storage callback (#1553)
commit 3934949 Na statful sig lock (#1559)
commit 3db6b44 Secret Key Query  (#1572)
commit 2446c64 Na stateful sigs lms var (#1574)
commit 8df2539 Stateful sigs XMSS updates (#1590)
commit a7b2987 SHA2 Increment with arbitrary length (non-block sizes) (#1614)
commit 2dd9e07 Na lms kat multi level (#1620)
commit 982b440 Fix Build Errors (#1635)
commit ddae644 Various fixes
commit cc50ef0 Fix warning
commit cf03392 Update README.md
commit 9325713 Update README.md
commit a52b217 Update README.md
commit d442ac9 Update README.md
commit 72ab478 Update README.md
commit 5967f12 Update src/CMakeLists.txt
commit fc6d512 Update documentation and license text. (#1663)
commit e7a83c7 Disable Stateful Signatures in the build by default (#1676)
commit 6c81bae Na stateful macro (#1687)

Signed-off-by: Norman Ashley <nashley@cisco.com>
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.

3 participants