Repository navigation
Conversation
An --enable-slhdsa string that names no parameter set, such as verify-only, small or no-s, passed configure and then failed to compile. Start such a string from the six SHAKE sets, as 'yes' does. no-s, no-f, no-sha2-s and no-sha2-f added group NO macros that wc_slhdsa.h drops when a set in the group is defined, so they were ignored. Take the group out of the selected sets in configure instead, leave the SHA2 family out when no SHA2 set is left, and stop with an error when no set is left (checked after the FIPS section). test_wc_slhdsa_param_disabled now probes TEST_SLHDSA_DEFAULT_PARAM, so it passes in SHA2-only builds without SHA2-128s. test_wc_SignCRL_slhdsa runs each case only when its 128s set is built and is skipped when neither is (its helper's guard follows), so it no longer fails with NOT_COMPILED_IN when SHAKE-128s, or SHA2-128s in a SHA2 build, is left out.
|
Can one of the admins verify this patch? |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The selection logic and test guards are consistent with the parameter contracts and FIPS flow, with no unresolved issues identified.
No open issues 🎉
What changed in this PR
This PR fixes SLH-DSA parameter selection in Autotools builds and updates API tests to support reduced parameter sets while preserving FIPS selection behavior.
Changes:
- Default modifier-only options to SHAKE sets, apply group exclusions, and reject empty selections after FIPS processing.
- Disable SHA2 dependencies when no SHA2 parameter sets remain.
- Use an enabled parameter for the disabled-set test and guard CRL cases by their required 128s sets.
| File | Description |
|---|---|
tests/api/test_slhdsa.c |
Uses the shared default parameter selection for the enabled-set probe. |
tests/api.c |
Gates SLH-DSA CRL tests and their helper on available 128s sets. |
configure.ac |
Corrects parameter defaults, exclusions, dependency handling, and empty-selection validation. |
Review effort: Balanced
Member
|
Okay to test. Contributor agreement on file. |
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.
Description
Fixes for the parameter set options of
--enable-slhdsa, and for two tests that fail in builds with fewer parameter sets.configure:
--enable-slhdsa=verify-only,small,small-mem,no-sorno-f, passes configure and then fails to compile (#error "No parameters defined"in wc_slhdsa.h), because every SHAKE set gets itsNOflag and the SHA2 family is off. Such a string now starts from the six SHAKE sets, asyesdoes, in the same way configure enables all ML-DSA levels when none is named, andno-sorno-fthen removes its group (below), sono-sgives the three fast SHAKE sets. The SHA2 sets stay opt-in.no-s,no-f,no-sha2-sandno-sha2-fadd a groupNOmacro, but wc_slhdsa.h drops a groupNOmacro when a set in that group is defined, and configure defines every selected set. So--enable-slhdsa=yes,no-sstill builds all six SHAKE sets. These options now take their group out of the selected sets in configure, including sets named in the same option string (the header's macro rules are unchanged). If that leaves no SHA2 set, the SHA2 family is left out too, with its SHA-256, SHA-512 and HMAC requirements. If it leaves no set at all, configure stops with an error. That check runs after the FIPS section, which selects all twelve sets for any--enable-slhdsavalue other than plainyes, so a FIPS v7 build with, for example,no-s,no-foryes,no-sstill gets all twelve sets, as before.tests:
test_wc_slhdsa_param_disabledlooks for an enabled set in a list that stops at SHA2-128s, so it fails in builds such as--enable-slhdsa=sha2-192forsha2-128f,verify-only. It now usesTEST_SLHDSA_DEFAULT_PARAM, the file's own choice of the first compiled-in set.test_wc_SignCRL_slhdsaalways runs the SHAKE-128s case (its comment says the SHAKE sets are always built), so with--enable-crl --enable-certgenit fails with -174 (NOT_COMPILED_IN) in builds such as--enable-slhdsa=sha2,sha2-192for128f. Each case now needs its 128s set, the only sets with a root certificate in certs/slhdsa, and the test, like the SLH-DSA part of its helper's guard, needs at least one of them.Testing
--enable-slhdsa=verify-only,smallandno-sfail to compile at#error "No parameters defined". With this change they build, with the six SHAKE sets forverify-onlyandsmalland the three fast SHAKE sets forno-s, andtest_wc_slhdsa_param_disabledpasses.yes,no-s, master builds all six SHAKE sets (checked by initializing a key for each set); with this change only 128f, 192f and 256f.yes,sha2,no-sha2-fgives the six SHAKE sets and the three small SHA2 sets.yes,sha2,no-sha2-s,no-sha2-fgives the six SHAKE sets without the SHA2 family, so it also builds with--disable-sha512.no-s,no-f,128s,no-sandsha2,no-sha2-s,no-sha2-fstop at configure with the new error. In a configure-only check with a stub fips.c,--enable-fips=v7withno-s,no-foryes,no-sstill selects all twelve sets.test_wc_slhdsa_param_disabledfails insha2-192fandsha2-128f,verify-onlybuilds (haveEnabled == 1fails), andtest_wc_SignCRL_slhdsafails with -174 insha2-192f,sha2and128fbuilds with--enable-crl --enable-certgen. With this changetest_wc_slhdsa_param_disabledpasses in both builds, andtest_wc_SignCRL_slhdsapasses in thesha2build (SHA2-128s case only) and is skipped in thesha2-192fand128fbuilds, which have no 128s set.--enable-slhdsa(alsotestwolfcrypt) and--enable-slhdsa=yes,sha2, both with--enable-crl --enable-certgen;--enable-slhdsa=no-swith ASan/UBSan, with no sanitizer reports; the slhdsa and slhdsa-verify-only entries of cryptocb-only.yml; and--enable-all --enable-all-quantum-crypto(full--api).Checklist