Skip to content

Guard old non-ctx ML-DSA API by default#10047

Merged
dgarske merged 1 commit intowolfSSL:masterfrom
Frauschi:mldsa_no_ctx
Mar 24, 2026
Merged

Guard old non-ctx ML-DSA API by default#10047
dgarske merged 1 commit intowolfSSL:masterfrom
Frauschi:mldsa_no_ctx

Conversation

@Frauschi
Copy link
Copy Markdown
Contributor

Summary

This PR guards the legacy non-context ML-DSA API behind WOLFSSL_DILITHIUM_NO_CTX and makes context-aware APIs the default path.

What changed

  • Added no-ctx as a valid --enable-dilithium option in configure.ac to explicitly enable legacy no-context APIs.
  • Wrapped legacy no-context C APIs and ML-DSA compatibility aliases in #ifdef WOLFSSL_DILITHIUM_NO_CTX in wolfssl/wolfcrypt/dilithium.h and wolfcrypt/src/dilithium.c.
  • Kept draft behavior compatible by auto-defining WOLFSSL_DILITHIUM_NO_CTX when WOLFSSL_DILITHIUM_FIPS204_DRAFT is enabled.
  • Updated internal consumers to FIPS 204-style context APIs (ctx=NULL, ctxLen=0):
    • wolfcrypt/test/test.c
    • wolfcrypt/benchmark/benchmark.c
    • Rust wrapper (build.rs, src/dilithium.rs)
  • Adjusted tests:
    • Legacy sign/verify tests now require WOLFSSL_DILITHIUM_NO_CTX.
    • Added/registered context KAT tests (test_wc_dilithium_sign_ctx_kats, test_wc_dilithium_verify_ctx_kats).

@Frauschi Frauschi marked this pull request as ready for review March 24, 2026 11:44
Copy link
Copy Markdown

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

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #10047

Scan targets checked: wolfcrypt-bugs, wolfcrypt-rs-bugs, wolfcrypt-rs-src, wolfcrypt-src

No new issues found in the changed files. ✅

@Frauschi Frauschi assigned wolfSSL-Bot and unassigned Frauschi Mar 24, 2026
@dgarske
Copy link
Copy Markdown
Member

dgarske commented Mar 24, 2026

Jenkins retest this please. Multi-test history lost.

@dgarske dgarske merged commit 328822b into wolfSSL:master Mar 24, 2026
491 of 492 checks passed
@Frauschi Frauschi deleted the mldsa_no_ctx branch March 24, 2026 16:31
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