Skip to content

SHA3 test improvements#2450

Open
mdcornu wants to merge 4 commits into
open-quantum-safe:mainfrom
mdcornu:tests/improve_sha3_test
Open

SHA3 test improvements#2450
mdcornu wants to merge 4 commits into
open-quantum-safe:mainfrom
mdcornu:tests/improve_sha3_test

Conversation

@mdcornu

@mdcornu mdcornu commented May 31, 2026

Copy link
Copy Markdown
Contributor

Improve tests/test_sha3.c with broader coverage and reduce vector duplication.

As per discussion on recent PR #2442:

  • Added extra NIST test vector with variable bytes
  • Added cross-validation for multi-absorb and multi-squeeze tests with one-shot API
  • Reduced vector duplication across tests
  • 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 will also need to be ready for review and merge by the time this is merged. Also, make sure to update the list of algorithms in the continuous benchmarking files: .github/workflows/kem-bench.yml and sig-bench.yml)

This code was partially generated using an AI coding assistant (GitHub Copilot - model: Claude Sonnet 4.6), but manually reviewed and verified before submission.

mdcornu added 4 commits May 30, 2026 20:31
Move msg0, msg24, msg448, msg896, and msg1600 from local declarations
repeated in each of the seven test functions into static const globals.

Signed-off-by: Cornu, Marcel D <marcel.d.cornu@intel.com>
…idation

Add 896-bit NIST vector and cross-validate inc API against one-shot API.

Signed-off-by: Cornu, Marcel D <marcel.d.cornu@intel.com>
Cross-validate SHAKE inc API against one-shot using absorb and
squeeze sweep, covering all code paths and rate-boundary transitions.
Add distinct x4 lane inputs to the four-way tests.

Signed-off-by: Cornu, Marcel D <marcel.d.cornu@intel.com>
Signed-off-by: Cornu, Marcel D <marcel.d.cornu@intel.com>
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage is 82.183%mdcornu:tests/improve_sha3_test into open-quantum-safe:main. No base build found for open-quantum-safe:main.

@mdcornu mdcornu marked this pull request as ready for review May 31, 2026 16:57
@mdcornu mdcornu requested review from bhess and xuganyu96 as code owners May 31, 2026 16:57
@xuganyu96 xuganyu96 assigned xuganyu96 and unassigned xuganyu96 Jun 1, 2026
@xuganyu96 xuganyu96 modified the milestone: 0.17.0 Jun 1, 2026
@xuganyu96

Copy link
Copy Markdown
Contributor

Thank you for the test enhancements! These are much needed for the less battle-tested implementations. I will review this first thing after 0.16.0-rc1 release.

@mdcornu

mdcornu commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

Thank you for the test enhancements! These are much needed for the less battle-tested implementations. I will review this first thing after 0.16.0-rc1 release.

No problem, thanks 👍

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