Feat: add tests to check slh-dsa key gen from seed - #7
Merged
Conversation
manel1874
marked this pull request as ready for review
February 20, 2026 17:56
mikelodder7
approved these changes
Feb 20, 2026
Greptile SummaryThis PR extends the existing
The algorithm names match the identifiers defined in Confidence Score: 4/5
|
| Filename | Overview |
|---|---|
| tests/sig_keypair_from_seed.c | Extends keypair-from-seed determinism tests to cover all 12 SLH-DSA PURE variants. Adds a get_seed_length() helper to compute the correct seed sizes (48/72/96 bytes) based on the algorithm's security level. Algorithm names, seed lengths, and array sizing are all correct. One stale comment remains from the pre-SLH-DSA version. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[main] --> B[Loop over algorithms array]
B --> C{Algorithm type?}
C -->|Falcon-512/1024| D[get_seed_length → 32 bytes]
C -->|ML-DSA-44/65/87| D
C -->|SLH_DSA_*_128*| E[get_seed_length → 48 bytes]
C -->|SLH_DSA_*_192*| F[get_seed_length → 72 bytes]
C -->|SLH_DSA_*_256*| G[get_seed_length → 96 bytes]
D --> H[test_keypair_from_seed_twice]
E --> H
F --> H
G --> H
H --> I[Generate seed with KAT PRNG]
I --> J[First keypair_from_seed call]
J --> K[Second keypair_from_seed call]
K --> L{Keys match?}
L -->|Yes| M[SUCCESS]
L -->|No| N[FAILURE]
Last reviewed commit: b8fe899
|
|
||
| OQS_STATUS overall_result = OQS_SUCCESS; | ||
|
|
||
| // Test each Falcon variant (Falcon-512 and Falcon-padded-512) |
There was a problem hiding this comment.
Stale comment after rename
This comment still says "Test each Falcon variant (Falcon-512 and Falcon-padded-512)" but the loop now iterates over all supported algorithms including ML-DSA and SLH-DSA variants. The comment should be updated to reflect the broader scope.
Suggested change
| // Test each Falcon variant (Falcon-512 and Falcon-padded-512) | |
| // Test each algorithm variant |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Forgot to comment on the previous PR that maybe we should add some tests for this.
How to run those from
liboqsmain folder: