Skip to content

Detect provider support for ML-DSA external-mu operations - #108

Merged
George Adams (gdams) merged 1 commit into
mainfrom
dev/gdams/mldsa-external-mu
Oct 28, 2026
Merged

George Adams (gdams) merged 1 commit into
mainfrom
dev/gdams/mldsa-external-mu

Conversation

@gdams

Copy link
Copy Markdown
Member

Summary

Add SupportsMLDSAExternalMu(params) so callers can distinguish general ML-DSA support from external-mu signing/verification support.

Azure Linux 4’s SymCrypt provider supports ML-DSA-44/65/87 but rejects the external-mu parameter (p_scossl_mldsa_set_ctx_params: not supported). This currently breaks crypto/mldsa.TestExternalMu in microsoft/go#2651.

  • Probe actual external-mu signing and verification once per parameter set and cache the result.
  • Return false for unsupported/invalid parameter sets without disabling ordinary ML-DSA.
  • Add capability-consistency tests. Keep normal ML-DSA tests running, gating only external-mu tests and benchmarks on that capability.
  • No new native bindings or generated-code changes.

Validation

  • ML-DSA and capability tests pass against local OpenSSL with external-mu support.
  • Tested the published Azure Linux 4 ARM64 CI image with its actual SymCrypt/OpenSSL 3.5.4 provider: ML-DSA/capability tests pass with both CGO_ENABLED=0 and CGO_ENABLED=1; external-mu is correctly reported unsupported while ordinary signing/verification remain covered.
  • go vet ./openssl and git diff --check pass.

Microsoft Go integration PRs will use this capability to choose the existing Go fallback, rather than skipping standard-library tests.

Expose a cached per-parameter capability probe that exercises native external-mu signing and verification. SymCrypt supports ML-DSA but rejects external-mu, so callers must distinguish these capabilities before choosing fallback operations. Keep ordinary ML-DSA coverage active and gate only external-mu tests and benchmarks on the new capability.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gdams
George Adams (gdams) requested a review from a team as a code owner October 28, 2026 12:53
Copilot AI balanced review requested due to automatic review settings October 28, 2026 12:53

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.

🟢 Approval recommended

There are no active review issues for the ML-DSA external-mu capability change.

No open issues 🎉

What changed in this PR

Adds a dedicated ML-DSA external-mu capability check so callers can select a fallback when a provider supports ordinary ML-DSA but not external-mu operations.

Changes:

  • Adds SupportsMLDSAExternalMu(params), caching an actual signing and verification probe per parameter set.
  • Adds capability-consistency tests and gates only external-mu tests and benchmarks, preserving ordinary ML-DSA coverage.
  • Requires no new native bindings or generated-code changes.
File Description
openssl/​mldsa.go Adds the external-mu capability API and cached probes.
openssl/​mldsa_test.go Tests capability consistency and gates external-mu tests and benchmarks.

Review effort: Balanced

@gdams
George Adams (gdams) enabled auto-merge (squash) October 28, 2026 12:55
@gdams

Copy link
Copy Markdown
Member Author

Microsoft Go integration PRs are ready:

Both pin this fix commit and use the new per-parameter capability to select the existing Go fallback. Built both patched toolchains and confirmed all three TestExternalMu cases pass against actual Azure Linux 4 SymCrypt with cgo enabled/disabled, including the CI FIPS environment. Full ML-DSA and dependency tests also pass. Go 1.26 has no ML-DSA integration.

@gdams
George Adams (gdams) merged commit c9be042 into main Oct 28, 2026
114 of 115 checks passed
@gdams
George Adams (gdams) deleted the dev/gdams/mldsa-external-mu branch October 28, 2026 13:05
@gdams

Copy link
Copy Markdown
Member Author

Go 1.27 dependency ordering corrected: the focused backport is #109 targeting ms-go1.27-support. Microsoft Go PR 2663 now pins that support-branch commit rather than this mainline commit. The Microsoft Go main integration remains on this mainline fix.

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results

⚠️ Issues detected — expand failed jobs below for details

✅ ubuntu-22.04-go1.26-cgo1-ossl3.0.13 · results
✅ ubuntu-22.04-go1.26-cgo1-ossl3.1.5 · results
✅ ubuntu-22.04-go1.26-cgo1-ossl3.2.1 · results
✅ ubuntu-22.04-go1.26-cgo1-ossl3.3.1 · results
✅ ubuntu-22.04-go1.26-cgo1-ossl3.4.0 · results
✅ ubuntu-22.04-go1.26-cgo1-ossl3.5.0 · results
✅ ubuntu-22.04-go1.27-cgo1-ossl3.0.13 · results
✅ ubuntu-22.04-go1.27-cgo1-ossl3.1.5 · results
✅ ubuntu-22.04-go1.27-cgo1-ossl3.2.1 · results
✅ ubuntu-22.04-go1.27-cgo1-ossl3.3.1 · results
✅ ubuntu-22.04-go1.27-cgo1-ossl3.4.0 · results

❌ ubuntu-22.04-go1.27-cgo1-ossl3.5.0

Regressions:

alloc regression: MLDSASign/87-4 [B/op] +0.02% (p=0.000, base 0%, head 0%)

📁 Full results

✅ ubuntu-24.04-arm-go1.26-cgo1-ossl3.0.13 · results
✅ ubuntu-24.04-arm-go1.26-cgo1-ossl3.1.5 · results
✅ ubuntu-24.04-arm-go1.26-cgo1-ossl3.2.1 · results
✅ ubuntu-24.04-arm-go1.26-cgo1-ossl3.3.1 · results
✅ ubuntu-24.04-arm-go1.26-cgo1-ossl3.4.0 · results
✅ ubuntu-24.04-arm-go1.26-cgo1-ossl3.5.0 · results
✅ ubuntu-24.04-arm-go1.27-cgo1-ossl3.0.13 · results
✅ ubuntu-24.04-arm-go1.27-cgo1-ossl3.1.5 · results
✅ ubuntu-24.04-arm-go1.27-cgo1-ossl3.2.1 · results
✅ ubuntu-24.04-arm-go1.27-cgo1-ossl3.3.1 · results
✅ ubuntu-24.04-arm-go1.27-cgo1-ossl3.4.0 · results
✅ ubuntu-24.04-arm-go1.27-cgo1-ossl3.5.0 · results
✅ ubuntu-latest-go1.26-cgo1-azl3 · results
✅ ubuntu-latest-go1.27-cgo1-azl3 · results

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.

3 participants