Skip to content

gate ML‑KEM/ML‑DSA specific SHA3 APIs behind optional features (#1532)#1542

Open
Arul-Sujith wants to merge 1 commit into
celabshq:mainfrom
Arul-Sujith:fix-sha3-mlkem-api
Open

gate ML‑KEM/ML‑DSA specific SHA3 APIs behind optional features (#1532)#1542
Arul-Sujith wants to merge 1 commit into
celabshq:mainfrom
Arul-Sujith:fix-sha3-mlkem-api

Conversation

@Arul-Sujith

Copy link
Copy Markdown
Contributor

This PR gates the ML‑KEM and ML‑DSA specific SHA3 APIs behind optional Cargo features (mlkem and mldsa). The change cleans up the public API surface of libcrux-sha3 by hiding specialized incremental functions (e.g., x4::incremental, x2::incremental, and portable::incremental) unless one of the new features is enabled.

Changes

  • Added mlkem and mldsa optional features to crates/algorithms/sha3/Cargo.toml.
  • Guarded ML‑KEM/ML‑DSA specific modules (avx2::x4, neon::x2, portable::incremental) with #[cfg(any(feature = "mlkem", feature = "mldsa"))].
  • Updated dependent crates (libcrux-ml-kem, libcrux-ml-dsa, ctgrind-test) to enable these features where needed.
  • Modified unit tests and benchmarks to be conditionally compiled under the same feature gate.

Fixes #1532

@robinhundt

Copy link
Copy Markdown
Contributor

Thanks for the PR! We recently added a policy on LLM-assisted submissions.

Did you use any AI tooling? If yes, to what capacity?

@Arul-Sujith

Copy link
Copy Markdown
Contributor Author

Yes, I used an LLM to assist with this PR. Primarily to understand codebase, apply fixes, and generate PR descriptions.

Then manually review the fixes and run tests. I will make sure to include this disclosure upfront in future PR descriptions.

@robinhundt

Copy link
Copy Markdown
Contributor

Is there a reason for this PR being stacked on top of #1541 ?

@Arul-Sujith

Copy link
Copy Markdown
Contributor Author

That was an accident! I forgot to branch off of main when starting this SHA3 work, so it included the commits from my previous PR. There is no intentional dependency between them. I have rebased this branch cleanly onto main to un-stack it!

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.

[sha3] Feature-gate specialized APIs

2 participants