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

Prepare PQC KEM KAT Tests for Classic McEliece #3892

Merged
merged 1 commit into from
Jan 18, 2024

Conversation

FAlbertDev
Copy link
Collaborator

This PR relates to the generalized PQC KEM KAT tests introduced in #3807. The following changes have been made.

  • Refactor the PK_PQC_KEM_KAT_Test class to use polymorphism instead of a templated Delegator.
  • Prepare the class for Classic McEliece, i.e., allow the child class to decide which KAT values are hashed in the KAT files. Also, allow the child class to override a callback to modify how the Fixed_Output_RNG is checked after keygen/encaps. In Classic McEliece, we do not know how much randomness is required; therefore, we need to soften the check in this case.
  • Apply the changes to the Tests of Kyber and FrodoKEM

@coveralls
Copy link

coveralls commented Jan 17, 2024

Coverage Status

coverage: 92.009% (-0.003%) from 92.012%
when pulling 0e30809 on Rohde-Schwarz:refactor/pqc-key-kat-test
into b8afed8 on randombit:master.

@reneme reneme self-requested a review January 18, 2024 06:10
Copy link
Collaborator

@reneme reneme left a comment

Choose a reason for hiding this comment

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

Nice. Certainly, this is more ergonomic than the delegate template. I'm still trying to remember why I went the template route initially: I believe, I didn't see a way to abstract from the different algorithm "mode" objects and didn't even think of using the high-level API in pk_algs.h. Thanks for spotting that!

A few things, but generally LGTM.

src/tests/test_pubkey_pqc.h Outdated Show resolved Hide resolved
src/tests/test_pubkey_pqc.h Outdated Show resolved Hide resolved
src/tests/test_pubkey_pqc.h Show resolved Hide resolved
src/tests/test_pubkey_pqc.h Outdated Show resolved Hide resolved
Use polymorphism for generalization and prepare for Classic McEliece
@FAlbertDev FAlbertDev force-pushed the refactor/pqc-key-kat-test branch from 37baf4f to 0e30809 Compare January 18, 2024 07:44
@FAlbertDev
Copy link
Collaborator Author

Thanks for your review, @reneme! I applied your suggestions.

@reneme reneme merged commit 7f15ce7 into randombit:master Jan 18, 2024
39 checks passed
@reneme reneme deleted the refactor/pqc-key-kat-test branch January 18, 2024 11:13
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