Skip to content

Add SLH-DSA (FIPS 205) to the FIPS module - #3877

Draft
jakemas wants to merge 1 commit into
mainfrom
feat/slh-dsa-1-module
Draft

jakemas wants to merge 1 commit into
mainfrom
feat/slh-dsa-1-module

Conversation

@jakemas

@jakemas jakemas commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Context and motivation

SLH-DSA (FIPS 205) is NIST's stateless hash-based signature standard. Its security rests only on the hash function, which makes it a conservative choice for long-lived signatures such as CA and firmware signing.

Description of changes

Adds SLH-DSA to the FIPS module in crypto/fipsmodule/slh_dsa, with the SHAKE-128s, SHAKE-192s and SHAKE-256s parameter sets. It is a port of slhdsa-c (4745143) onto AWS-LC's SHAKE.

  • Key generation, pure SLH-DSA with context strings, and HashSLH-DSA (SHAKE128 for 128s only, or SHAKE256).
  • The FIPS 205 internal functions, used by the tests.
  • Secret intermediates are cleansed (FIPS 205, Section 3.1).

There is no EVP or TLS support in this PR, and SLH-DSA is not an approved FIPS service yet.

Testing

  • NIST ACVP-Server vectors for keyGen, sigGen and sigVer on all three parameter sets.
  • Negative and API tests.
  • Signing is slow, so crypto_test runs a subset of the signing tests. The rest run natively from util/all_tests.json, not under valgrind or SDE.

Review considerations

  • No public API. The new module functions are registered as PRIVATE symbols.
  • FileTest's line buffer grows to 112 KB, as in BoringSSL, so that SHAKE-256s signatures fit.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

Add SLH-DSA with the SHAKE-128s, SHAKE-192s and SHAKE-256s parameter
sets in crypto/fipsmodule/slh_dsa. It is a port of slhdsa-c
(pq-code-package/slhdsa-c@4745143) onto AWS-LC's SHAKE implementation.

This covers key generation, pure SLH-DSA with context strings,
HashSLH-DSA with SHAKE128 (SLH-DSA-SHAKE-128s only) or SHAKE256, and
the FIPS 205 internal functions used by the tests. Secret intermediates
are cleansed. There is no EVP or TLS support yet, and SLH-DSA is not an
approved FIPS service.

Tests use a subset of the NIST ACVP vectors. Signing is slow, so the
tests that sign many times are disabled by default and run natively from
util/all_tests.json, not under valgrind or SDE. FileTest's line buffer is
raised to fit SHAKE-256s signatures, as in BoringSSL.
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

🔒 Security Review — View Report

Please review before merging.

@jakemas
jakemas force-pushed the feat/slh-dsa-1-module branch from 63d1809 to c33ca1d Compare December 3, 2026 22:16
@codecov-commenter

codecov-commenter commented Dec 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 99.64830% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.21%. Comparing base (56d0552) to head (c33ca1d).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
crypto/fipsmodule/slh_dsa/slh_dsa.c 98.87% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##           main    #3877       +/-   ##
=========================================
+ Coverage      0   79.21%   +79.21%     
=========================================
  Files         0      724      +724     
  Lines         0   136464   +136464     
  Branches      0    19611    +19611     
=========================================
+ Hits          0   108101   +108101     
- Misses        0    27319    +27319     
- Partials      0     1044     +1044     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

This branch has not been deployed

No deployments
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.

2 participants