Skip to content

Add support for for SLH-DSA - #512

Open
padelsbach wants to merge 16 commits into
wolfSSL:mainfrom
padelsbach:add-crypto-cb-slhdsa
Open

padelsbach wants to merge 16 commits into
wolfSSL:mainfrom
padelsbach:add-crypto-cb-slhdsa

Conversation

@padelsbach

Copy link
Copy Markdown
Contributor

No description provided.

@padelsbach
padelsbach force-pushed the add-crypto-cb-slhdsa branch 2 times, most recently from aed3238 to 7fe4069 Compare August 21, 2026 23:20
@padelsbach
padelsbach force-pushed the add-crypto-cb-slhdsa branch 4 times, most recently from 64514ae to a9eb8a9 Compare September 16, 2026 19:16
@padelsbach
padelsbach marked this pull request as ready for review September 16, 2026 19:49
@padelsbach
padelsbach requested review from Frauschi, bigbrett and wolfSSL-Fenrir-bot and removed request for bigbrett September 16, 2026 19:49

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #512

Scan targets checked: wolfhsm-core-bugs, wolfhsm-crypto-bugs, wolfhsm-src

Findings: 11
11 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Reported findings require changes before merge.

Comment thread test-refactor/client-server/wh_test_crypto_slhdsa.c
Comment thread src/wh_client_cryptocb.c Outdated
Comment thread src/wh_client_crypto.c Outdated
Comment thread src/wh_client_crypto.c Outdated
Comment thread src/wh_server_crypto.c Outdated
Comment thread test-refactor/client-server/wh_test_crypto_slhdsa.c
Comment thread src/wh_client_crypto.c Outdated
Comment thread src/wh_client_crypto.c Outdated
Comment thread src/wh_client_crypto.c Outdated
Comment thread src/wh_client_crypto.c

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #512

Scan targets checked: wolfhsm-core-bugs, wolfhsm-crypto-bugs, wolfhsm-src

Findings: 7
7 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Reported findings require changes before merge.

Comment thread src/wh_client_crypto.c Outdated
Comment thread src/wh_server_crypto.c
Comment thread src/wh_server_crypto.c Outdated
Comment thread src/wh_server_crypto.c
Comment thread src/wh_client_crypto.c
Comment thread src/wh_server_crypto.c
Comment thread test-refactor/client-server/wh_test_crypto_slhdsa.c

@Frauschi Frauschi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Went through the SLH-DSA callback support. Big addition, and the structure mirrors the ML-DSA paths closely enough to follow easily.

Comments inline. The ones I would most like to see addressed are the DMA READ_POST after a denied READ_PRE in _HandleSlhDsaVerifyDma, the unvalidated seedSz / 3 in both keygen handlers, and the seed left resident in the comm packet. The rest are smaller consistency points against the ML-DSA and ML-KEM siblings, and the last few are nits you can take or leave.

Nothing here is a blocker.

Comment thread src/wh_client_cryptocb.c
Comment thread src/wh_client_crypto.c
Comment thread src/wh_client_crypto.c
Comment thread src/wh_client_crypto.c Outdated
Comment thread test-refactor/client-server/wh_test_crypto_slhdsa.c
Comment thread src/wh_server_crypto.c Outdated
Comment thread src/wh_crypto.c
Comment thread wolfhsm/wh_message_crypto.h Outdated
Comment thread src/wh_server_crypto.c Outdated
Comment thread test-refactor/wh_test_list.c Outdated

@Frauschi Frauschi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Two small follow-ups from the last round - neither is blocking, and the rest of what I raised looks good now.

Comment thread src/wh_server_crypto.c
Comment thread src/wh_client_crypto.c Outdated
@Frauschi Frauschi removed their assignment Sep 22, 2026
Frauschi
Frauschi previously approved these changes Sep 23, 2026
@Frauschi Frauschi assigned bigbrett and unassigned Frauschi Sep 23, 2026
@padelsbach padelsbach changed the title Add crypto callback mode for SLH-DSA Add support for for SLH-DSA Sep 25, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Cache-mode flag handling, DER error reporting, and DMA cleanup can currently produce false success or leave unintended cached keys.

Review effort: Balanced
Findings: 3 Medium severity

Open (3)
What changed in this PR

Adds end-to-end SLH-DSA support across wolfHSM, including key management, signing, verification, DMA, crypto callbacks, examples, and CI coverage.

Changes:

  • Adds SLH-DSA wire protocols and client/server cryptographic operations.
  • Supports cached, exported, seeded, non-DMA, DMA, and callback-only workflows.
  • Extends configuration, tests, examples, and CI for SLH-DSA.
File Description
wolfhsm/​wh_settings.h Documents SLH-DSA buffer requirements.
wolfhsm/​wh_server_crypto.h Declares server cache helpers.
wolfhsm/​wh_message_crypto.h Defines SLH-DSA wire messages.
wolfhsm/​wh_crypto.h Declares DER serialization support.
wolfhsm/​wh_common.h Adds the SLH-DSA algorithm identifier.
wolfhsm/​wh_client_crypto.h Exposes client SLH-DSA APIs.
test/​wh_test_check_struct_padding.c Covers new message layouts.
test/​config/​user_settings.h Enables SLH-DSA in tests.
test-refactor/​wh_test_list.c Registers SLH-DSA tests.
test-refactor/​posix/​Makefile Adds verify-only configuration.
test-refactor/​misc/​wh_test_check_struct_padding.c Covers refactored message layouts.
src/​wh_server_keystore.c Supports public-key export.
src/​wh_server_crypto.c Implements server operations and DMA handlers.
src/​wh_message_crypto.c Implements message translation.
src/​wh_crypto.c Implements SLH-DSA DER conversion.
src/​wh_client_cryptocb.c Integrates wolfCrypt callbacks.
src/​wh_client_crypto.c Implements client and DMA APIs.
examples/​posix/​wh_posix_server/​user_settings.h Enables server-side SLH-DSA.
examples/​posix/​wh_posix_client/​user_settings.h Enables client and callback-only modes.
examples/​posix/​wh_posix_client/​Makefile Adds callback-only build selection.
examples/​demo/​client/​wh_demo_client_crypto.h Declares the SLH-DSA demo.
examples/​demo/​client/​wh_demo_client_crypto.c Implements the SLH-DSA demo.
examples/​demo/​client/​wh_demo_client_all.c Runs the SLH-DSA demo.
.github/​workflows/​build-and-test-refactor.yml Tests verify-only builds.
.github/​workflows/​build-and-run-examples.yml Tests callback-only operation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/wh_client_crypto.c Outdated
Comment thread src/wh_client_crypto.c Outdated
Comment thread src/wh_crypto.c
@padelsbach
padelsbach requested review from Frauschi and a balanced review from Copilot October 3, 2026 00:42
@padelsbach padelsbach removed their assignment Oct 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Non-DMA responses expose uninitialized padding, and the server header lacks the required SLH-DSA type include.

Review effort: Balanced
Findings: 2 High severity

Open (2)
Resolved since last review (3)

Comment thread src/wh_server_crypto.c
int ret;
SlhDsaKey key[1];
whMessageCrypto_SlhDsaSignRequest req;
whMessageCrypto_SlhDsaSignResponse res;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed

Comment thread wolfhsm/wh_server_crypto.h
@bigbrett bigbrett assigned padelsbach and unassigned bigbrett Oct 5, 2026
@bigbrett

bigbrett commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

@padelsbach can you check the copilot comments and address if necessary, otherwise resolve and reassign me plz

@padelsbach
padelsbach force-pushed the add-crypto-cb-slhdsa branch 2 times, most recently from bbc5a63 to aa14855 Compare October 9, 2026 16:06
@padelsbach
padelsbach force-pushed the add-crypto-cb-slhdsa branch from fe43259 to 9efa82f Compare October 13, 2026 04:40
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.

5 participants