Skip to content

Add ML-KEM and ML-DSA support#399

Open
aidangarske wants to merge 43 commits into
wolfSSL:masterfrom
aidangarske:pqc-support
Open

Add ML-KEM and ML-DSA support#399
aidangarske wants to merge 43 commits into
wolfSSL:masterfrom
aidangarske:pqc-support

Conversation

@aidangarske
Copy link
Copy Markdown
Member

@aidangarske aidangarske commented May 23, 2026

ML-KEM (FIPS 203) and ML-DSA (FIPS 204) via wolfSSL backend.

Algorithms: ML-KEM-512/768/1024, ML-DSA-44/65/87 hybrid schemes supported now as well

Opt-in: ./scripts/build-wolfprovider.sh --enable-pqc (adds --enable-mlkem --enable-mldsa to wolfSSL).

  • PQC is not auto detected its only enabled when specifically built.
  • Ability to enable either algo only or both
  • Reject pqc with debian bookworm build could test with trixie eventually
  • ML-DSA CertificateVerify signing and verification both work in TLS
  • wolfProvider now generates ML-DSA certs
  • wolfProvider X509 ML-DSA sigs are valid
  • osp integration with https://github.com/open-quantum-safe/oqs-demos/tree/main/nginx using ML-DSA and hybrid schemes and tested in CI

Validation: three independent paths cross-checked, all pass.

  • Internal unit tests (11 functions x 3 levels = 33 assertions) in make test
  • wolfProvider <-> OpenSSL 3.6+ default provider (12 cross-pairs)
  • wolfProvider <-> wolfSSL direct wc_* API (12 cross-pairs)
  • entire openssl mldsa mlkem test suite exercised in CI for full compatibility
  • Interop tests with hybrid in place as well

CI: new wolfssl-versions-pqc.yml runs three matrix rows - pre-PQC wolfSSL, latest stable, master -- and the three-way interop validator on the PQC-enabled rows.

  • Put floor to 3.6 where mldsa apis solid and 5.9.2 for pqc in general; added note that we could do lower than 3.6 if reuqested but offically support and test those higher versions

supplemental PR for interop test in wolfCrypt: wolfSSL/wolfssl#10603

Test plan

  • make test passes (all 11 PQC tests + existing suite)
  • ./test/pqc_interop.test -- ALL PASS (24 cross-pairs)
  • Build against pre-PQC wolfSSL: PQC code paths skip, make test clean
  • CI green on all three matrix rows

Copilot AI review requested due to automatic review settings May 23, 2026 05:56

This comment was marked as resolved.

@aidangarske aidangarske self-assigned this May 23, 2026
@aidangarske aidangarske marked this pull request as ready for review May 26, 2026 17:13
Copy link
Copy Markdown

@Frauschi Frauschi left a comment

Choose a reason for hiding this comment

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

Some smaller findings. The biggest "issue" imo is the usage of the now old ML-DSA API instead of the new one. But moving this to the new one should be easy.

Comment thread docs/INTEGRATION_GUIDE.md Outdated
Comment thread docs/INTEGRATION_GUIDE.md Outdated
Comment thread docs/INTEGRATION_GUIDE.md Outdated
Comment thread docs/INTEGRATION_GUIDE.md Outdated
Comment thread docs/INTEGRATION_GUIDE.md Outdated
Comment thread src/wp_mldsa_kmgmt.c Outdated
Comment thread src/wp_mldsa_kmgmt.c Outdated
Comment thread src/wp_mldsa_kmgmt.c Outdated
Comment thread src/wp_mldsa_kmgmt.c
Comment thread src/wp_mlkem_kmgmt.c
@Frauschi
Copy link
Copy Markdown

Jenkins retest this please

@aidangarske aidangarske requested a review from Frauschi May 29, 2026 23:43
@aidangarske
Copy link
Copy Markdown
Member Author

Jenkins retest this please

Frauschi
Frauschi previously approved these changes Jun 1, 2026
Copy link
Copy Markdown

@Frauschi Frauschi left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread src/wp_mldsa_kmgmt.c
Comment thread src/wp_mldsa_kmgmt.c
Comment thread src/wp_mlkem_kmgmt.c
Comment thread test/standalone/tests/pqc_interop/test_pqc_interop.c
…) with version-floor gates and per-algorithm CI coverage
…fault, both directions, all ML-KEM and hybrid groups)
…idate as trust anchors (EVP_PKEY_is_a / check_sig_alg_match)
…Test::Nginx harness (wolfSSL stable+master, latest OpenSSL, force-fail, pinned nginx/nginx-tests)
…d for oqs-provider, exercising ML-DSA auth + ML-KEM/hybrid KEX via their connection test
…hybrid-group KEM; run all PQC unit tests in CI
…ify per group), validating the ML-DSA TLS signature algorithm end-to-end
…pply FIPS 204 sig params in all init paths, reject wrong-length keygen seed, close hybrid match fail-open
…t, reject wrong-length IKME/test-entropy, scrub hybrid shared secret on failure, fix fill_rnd log flag
…erive ECC public on hybrid private import, scrub ML-KEM shared secret on failure
…dersized buffer (early-return on size check), reject mismatched public on hybrid keypair import
…A public only when actually decoded, give hybrid variant tables internal linkage
@aidangarske aidangarske requested a review from SparkiDev June 5, 2026 22:16
….9.2); fix wget TLS by setting LD_LIBRARY_PATH after nginx download
…rray of GIDs, so the loop ran once with a GID); drop install-layout-dependent mime.types include; add startup debug
…per wolfSSL ref), loading wolfProvider via provider.conf in non-replace builds
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.

6 participants