[ml-dsa]Implement Zeroize for MLDSASigningKey/[traits,secrets,chacha20poly1305]Implement Zeroize for AEAD Key#1387
Open
MavenRain wants to merge 2 commits into
Open
[ml-dsa]Implement Zeroize for MLDSASigningKey/[traits,secrets,chacha20poly1305]Implement Zeroize for AEAD Key#1387MavenRain wants to merge 2 commits into
MavenRain wants to merge 2 commits into
Conversation
…0poly1305]Implement Zeroize for AEAD Key Add an optional `zeroize` feature implementing Zeroize, Drop, and ZeroizeOnDrop for MLDSASigningKey<SIZE> and MLDSAKeyPair. MLDSAKeyPair clears only the signing key; the verification key is public material. Gated on `not(hax)` so hax extraction is unaffected. Closes celabshq#1370. Add an optional `zeroize` feature: - libcrux-secrets: `Zeroize for Secret<T> where T: Zeroize`, so `[U8; N]` zeroizes under both default (U8 = u8) and `check-secret-independence` (U8 = Secret<u8>) configurations. - libcrux-traits: `Zeroize for typed_owned::Key<Algo>` where `Algo::Key: Zeroize`. Covers `chacha20poly1305::Key` and any future AEAD whose key bytes are Zeroize. - libcrux-chacha20poly1305: `zeroize` feature forwarding to both. Drop and ZeroizeOnDrop are not implemented in this PR. Adding them requires `Algo::Key: Zeroize` as a bound on `typed_owned::Aead` (or a sealed helper trait), which is a larger trait-level change. Happy to follow up if maintainers want one of those approaches. In the meantime, callers wanting drop-on-zero can wrap in `zeroize::Zeroizing<Key<...>>`. Closes celabshq#1375.
Resolve conflict in crates/algorithms/chacha20poly1305/Cargo.toml dev-dependencies: keep the upstream upgrade to rand_core 0.10 (and the new rand = "0.10" with the sys_rng feature) alongside the zeroize dev-dep added on this branch.
Collaborator
Contributor
|
This PR has been marked as stale due to a lack of activity for 60 days. If you believe this pull request is still relevant, please provide an update or comment to keep it open. Otherwise, it will be closed in 7 days. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add an optional
zeroizefeature implementing Zeroize, Drop, andZeroizeOnDrop for MLDSASigningKey and MLDSAKeyPair. MLDSAKeyPair
clears only the signing key; the verification key is public material.
Gated on
not(hax)so hax extraction is unaffected.Closes #1370.
Add an optional
zeroizefeature:Zeroize for Secret<T> where T: Zeroize, so[U8; N]zeroizes under both default (U8 = u8) andcheck-secret-independence(U8 = Secret) configurations.Zeroize for typed_owned::Key<Algo>whereAlgo::Key: Zeroize. Coverschacha20poly1305::Keyand any future AEAD whose key bytes are Zeroize.zeroizefeature forwarding to both.Drop and ZeroizeOnDrop are not implemented in this PR. Adding them
requires
Algo::Key: Zeroizeas a bound ontyped_owned::Aead(or asealed helper trait), which is a larger trait-level change. Happy to
follow up if maintainers want one of those approaches. In the meantime,
callers wanting drop-on-zero can wrap in
zeroize::Zeroizing<Key<...>>.Closes #1375.