-
Notifications
You must be signed in to change notification settings - Fork 34
Add ML-KEM and ML-DSA support #399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aidangarske
wants to merge
43
commits into
wolfSSL:master
Choose a base branch
from
aidangarske:pqc-support
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 19 commits
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
aad005d
Add PQC scaffolding: ML-KEM/ML-DSA macros, names, externs, build flag
aidangarske d203979
Add ML-KEM keymgmt and KEM dispatch for 512/768/1024
aidangarske be25627
Add ML-DSA keymgmt and signature dispatch for 44/65/87
aidangarske 3df1a6f
Add ML-KEM and ML-DSA unit tests + dupctx buffer copy fix
aidangarske f78fdb8
Add PQC version-compat CI: pre-PQC, latest stable, master
aidangarske c1b7c10
Add FIPS 204 ctx mode for ML-DSA + three-way interop validator in CI
aidangarske 60f2cd6
Add ML-KEM and ML-DSA raw key import/export roundtrip tests
aidangarske dae5cd6
Gate PQC macros on header availability via __has_include
aidangarske 0aec54f
Address Copilot review + dynamic wolfSSL version matrix with PQC floor
aidangarske 618ad0a
Document ML-KEM and ML-DSA support in README and integration guide
aidangarske 39e677c
Address Skoll review: input validation, consistency checks, dup selec…
aidangarske ef9ac48
Run PQC version matrix on draft PRs too (match wolfTPM behavior)
aidangarske ed58142
Use wc_mlkem.h (mlkem.h removed on wolfssl master); drop absence check
aidangarske 0b04e5a
CI: diagnose OpenSSL default provider PQC support
aidangarske 371c4e6
interop: use global lib ctx for default provider side (CI lib ctx fix)
aidangarske f69c064
CI: include lib64 in LD_LIBRARY_PATH so Linux finds the local libcrypto
aidangarske c2bd794
PQC: canonical ML-KEM/ML-DSA APIs + address review feedback
aidangarske ec3e26d
PQC: address skoll review (empty msg, NULL-key reinit, KEM mixed-NULL…
aidangarske 65953c2
PQC: address review nits (drop experimental mentions, early-return in…
aidangarske 8f4e35c
Add PQC OpenSSL-vector KAT CI, ML-DSA message API, seed/ikme keygen p…
aidangarske 343d15c
Make ML-KEM/ML-DSA opt-in (--enable-pqc/--enable-mlkem/--enable-mldsa…
aidangarske 164174c
KAT CI: add --enable-openssl-test so replace-default builds OpenSSL e…
aidangarske c0e556f
Add pure ML-KEM TLS groups (MLKEM512/768/1024) with encoded-public-ke…
aidangarske 9a91a59
Add hybrid PQC TLS groups (X25519MLKEM768, SecP256r1MLKEM768, SecP384…
aidangarske ef4602c
PQC interop: add TLS 1.3 handshake group interop (wolfProvider <-> de…
aidangarske 8b190ba
Add ML-DSA encoder/decoder (PEM/DER SPKI+PKCS8) so ML-DSA keys and ce…
aidangarske f19fb30
Register ML-DSA TLS signature algorithms (mldsa44/65/87) so ML-DSA ce…
aidangarske f2c1a1f
Provide ML-DSA X509 signature AlgorithmIdentifier so wolfProvider can…
aidangarske 2a43b3d
Register ML-DSA keymgmt OID/short-name aliases so ML-DSA CA certs val…
aidangarske fe77e16
Add nginx PQC OSP CI: ML-DSA cert auth + ML-KEM/hybrid KEX via nginx …
aidangarske 6c9e411
nginx PQC OSP: run oqs-demos nginx in Docker with wolfProvider swappe…
aidangarske e4f1839
Add unit tests for ML-DSA encoder/decoder, ML-DSA X.509 signing, and …
aidangarske 282e5ec
PQC interop: add ML-DSA certificate TLS authentication test (sign+ver…
aidangarske dc2cd4f
PQC security review fixes: zeroize seed/entropy/randomizer on free, a…
aidangarske 31bd1df
PQC security review round 2: apply+validate keygen seed params at ini…
aidangarske 368f26b
PQC security review round 3: use sigSize as authoritative capacity, d…
aidangarske 0c27517
PQC security review round 4: fix ML-KEM KEM out-of-bounds scrub on un…
aidangarske 49260ae
PQC security review round 5: copy IKME on KEM dupctx, advertise ML-DS…
aidangarske 0f9d2a5
PQC security review round 6: reject NULL ML-DSA message update with n…
aidangarske 32ff44d
nginx PQC test: lengthen HTTP response wait to avoid handshake-timing…
aidangarske 009a00c
nginx PQC CI: skip pre-PQC-floor wolfSSL stable (master-only until v5…
aidangarske fd9083b
nginx PQC test: rename GROUPS->KEX_GROUPS (GROUPS is a bash special a…
aidangarske 39fa5d2
nginx PQC: add replace-default/non-replace as a matrix axis (4 modes …
aidangarske File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| name: wolfSSL Versions (PQC) | ||
|
|
||
| # Backward-compatibility matrix for ML-KEM and ML-DSA. Mirrors wolfTPM's | ||
| # wolfssl-versions-pqc.yml pattern: a discover-versions job dynamically | ||
| # resolves the latest -stable wolfSSL tag and decides if it is past the PQC | ||
| # floor, then the build job runs three rows: pre-PQC floor, dynamically | ||
| # resolved latest -stable, and master. | ||
| # | ||
| # PQC_FLOOR is v5.9.1-stable: the wc_MlDsaKey_* / wc_dilithium_sign_ctx_msg | ||
| # API that wolfProvider's PQC code depends on lands post-v5.9.1-stable | ||
| # (wolfSSL PR #10436), so v5.9.2-stable+ is the first PQC-eligible release. | ||
| # Older wolfSSL versions skip the PQC code paths via settings.h gating and | ||
| # only verify the no-symbol path still builds. | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ 'master', 'main', 'release/**' ] | ||
| pull_request: | ||
| branches: [ '*' ] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| discover-versions: | ||
| name: Resolve wolfSSL version matrix | ||
| runs-on: ubuntu-22.04 | ||
| outputs: | ||
| matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
| latest-stable: ${{ steps.set-matrix.outputs.latest-stable }} | ||
| steps: | ||
| - name: Resolve latest -stable wolfSSL tag | ||
| id: set-matrix | ||
| run: | | ||
| set -euo pipefail | ||
| LATEST=$(git ls-remote --tags --refs \ | ||
| https://github.com/wolfSSL/wolfssl.git 'v*-stable' \ | ||
| | awk -F/ '{print $NF}' | sort -V | tail -n 1) | ||
| if [ -z "${LATEST:-}" ]; then | ||
| echo "::error::Could not resolve latest wolfSSL -stable tag" | ||
| exit 1 | ||
| fi | ||
| echo "Latest stable wolfSSL: $LATEST" | ||
| echo "latest-stable=$LATEST" >> "$GITHUB_OUTPUT" | ||
| # Enable PQC when $LATEST is strictly newer than v5.9.1-stable | ||
| # (i.e. v5.9.2-stable, v5.10+, v6+, ...). Anything at or before | ||
| # the floor lacks the wc_MlDsaKey_* / wc_dilithium_sign_ctx_msg | ||
| # API and stays on the no-symbol path. | ||
| PQC_FLOOR="v5.9.1-stable" | ||
| if [ "$(printf '%s\n%s\n' "$PQC_FLOOR" "$LATEST" \ | ||
| | sort -V | tail -n1)" != "$PQC_FLOOR" ]; then | ||
| LATEST_PQC_ELIGIBLE=true | ||
| else | ||
| LATEST_PQC_ELIGIBLE=false | ||
| fi | ||
| echo "latest-stable PQC eligible: $LATEST_PQC_ELIGIBLE" | ||
| MATRIX=$(jq -nc \ | ||
| --arg latest "$LATEST" \ | ||
| --argjson latest_pqc "$LATEST_PQC_ELIGIBLE" '{ | ||
| include: [ | ||
| {"name":"pre-PQC (v5.8.0-stable, PQC disabled)", | ||
| "wolfssl-ref":"v5.8.0-stable","pqc":false}, | ||
| {"name":("latest stable (" + $latest + ", PQC " + | ||
| (if $latest_pqc then "enabled" else "disabled" end) + ")"), | ||
| "wolfssl-ref":$latest,"pqc":$latest_pqc}, | ||
| {"name":"master (PQC enabled)", | ||
| "wolfssl-ref":"master","pqc":true} | ||
| ] | ||
| }') | ||
| echo "matrix=$MATRIX" >> "$GITHUB_OUTPUT" | ||
|
|
||
| pqc-build-test: | ||
| name: ${{ matrix.name }} | ||
| needs: discover-versions | ||
| runs-on: ubuntu-22.04 | ||
| timeout-minutes: 30 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: ${{ fromJson(needs.discover-versions.outputs.matrix) }} | ||
| steps: | ||
| - name: Checkout wolfProvider | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| # OpenSSL is pinned to 3.5.4 on every row so the cross-provider interop | ||
| # test can verify against the default provider's native ML-KEM/ML-DSA. | ||
| # OpenSSL 3.5 is the first release with native PQC support; older 3.x | ||
| # versions can build wolfProvider but the interop step would have | ||
| # nothing to compare against on the default-provider side. | ||
| - name: Build wolfProvider (PQC=${{ matrix.pqc }}) | ||
| run: | | ||
| if [ "${{ matrix.pqc }}" = "true" ]; then | ||
| OPENSSL_TAG=openssl-3.5.4 \ | ||
| WOLFSSL_TAG=${{ matrix.wolfssl-ref }} \ | ||
| ./scripts/build-wolfprovider.sh --enable-pqc | ||
| else | ||
| OPENSSL_TAG=openssl-3.5.4 \ | ||
| WOLFSSL_TAG=${{ matrix.wolfssl-ref }} \ | ||
| ./scripts/build-wolfprovider.sh | ||
| fi | ||
|
|
||
| # On PQC-enabled rows the PQC tests must be present. We do NOT assert | ||
| # absence on the no-PQC rows because v5.9.x's --enable-all-crypto now | ||
| # auto-enables MLKEM/DILITHIUM, so the "latest stable" row will pick up | ||
| # PQC at the wolfSSL level even without --enable-pqc. wolfProvider | ||
| # auto-detects and compiles in the PQC code in that case, which is fine. | ||
| - name: Confirm PQC tests present on PQC-enabled rows | ||
| if: matrix.pqc == true | ||
| run: | | ||
| ./test/unit.test --list | grep -q 'test_mlkem_keygen' \ | ||
| || { echo 'ERROR: PQC tests missing in PQC-enabled build'; \ | ||
| exit 1; } | ||
| ./test/unit.test --list | grep -q 'test_mldsa_sign_verify' \ | ||
| || { echo 'ERROR: ML-DSA tests missing in PQC-enabled build'; \ | ||
| exit 1; } | ||
|
|
||
| # Three-way interop: wolfProvider <-> OpenSSL default <-> wolfSSL direct. | ||
| # Only runs on PQC-enabled rows; OpenSSL 3.5+ has native ML-KEM/ML-DSA | ||
| # in the default provider, so this proves wolfProvider's bytes are | ||
| # FIPS 203/204 standards-compliant against two reference implementations. | ||
| # Linux x86_64 OpenSSL installs to lib64 by default; LD_LIBRARY_PATH | ||
| # must include both lib and lib64 or the dynamic linker falls through | ||
| # to the system libcrypto/libssl (Ubuntu 22.04 ships 3.0.2, which has | ||
| # no ML-KEM/ML-DSA in the default provider). | ||
| - name: Three-way PQC interop validation | ||
| if: matrix.pqc == true | ||
| run: | | ||
| LD_LIBRARY_PATH="$(pwd)/wolfssl-install/lib:$(pwd)/openssl-install/lib:$(pwd)/openssl-install/lib64" \ | ||
| ./test/pqc_interop.test | ||
|
|
||
| - name: Print errors on failure | ||
| if: ${{ failure() }} | ||
| run: | | ||
| if [ -f test-suite.log ]; then | ||
| cat test-suite.log | ||
| fi |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.