Skip to content

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

Draft
Frauschi wants to merge 1 commit intowolfSSL:masterfrom
Frauschi:mldsa_no_ctx
Draft

Guard old non-ctx ML-DSA API by default#10047
Frauschi wants to merge 1 commit intowolfSSL:masterfrom
Frauschi:mldsa_no_ctx

Conversation

@Frauschi
Copy link
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).

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.

1 participant