Update crypto dependencies to chacha20poly1305 0.11 and dalek v3#408
Conversation
- chacha20poly1305 0.10 -> 0.11, ed25519-dalek 2 -> 3, x25519-dalek 2 -> 3 - STREAM construction now comes from the aead-stream crate (removed from aead 0.6) - generate private keys directly from the OS CSPRNG - zeroize the cipher key schedule, secret shares and serialization intermediates - rewrite online_ciphertext doctests to use the STREAM API - add a cross-version STREAM conformity vector
31b5412 to
dffd15a
Compare
There was a problem hiding this comment.
Pull request overview
This PR upgrades the cryptographic dependency stack (chacha20poly1305 0.10→0.11, ed25519-dalek 2→3, x25519-dalek 2→3) and migrates the STREAM construction to the newly split aead-stream crate, since stream was removed from aead 0.6. Alongside the version bumps, it hardens secret handling with zeroize and moves private-key generation to draw seeds directly from the OS CSPRNG (SysRng) via a new utils::random_bytes helper. As the author notes, dalek v3 types surface in public From impls and the MSRV rises, so the Rust API is semver-breaking, but the on-disk/wire formats are unchanged and covered by conformity vectors.
Changes:
- Bumped crypto crates and switched STREAM to
aead-stream; updated cipher construction tonew_from_slice(...)and error/Fromplumbing tochacha20poly1305::aead::Error. - Added
utils::random_bytes::<N>() -> Zeroizing<[u8; N]>and routed all private-key/ephemeral-key generation through it (plus additionalZeroizingof serialization intermediates and secret shares). - Rewrote the
online_ciphertextmodule docs/doctests to reflect the chunked STREAM API and added a cross-version STREAM known-answer conformity vector.
Reviewed changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Bumps crypto deps, adds aead-stream, and enables zeroize-related features. |
| Cargo.lock | Regenerated lock reflecting the new dependency graph (single aead 0.6). |
| src/utils.rs | Adds random_bytes helper returning a zeroizing fixed-size buffer from SysRng. |
| src/key/key_v1.rs | Generates/loads X25519 secrets via random_bytes and zeroizes intermediates. |
| src/key/secret_key_v1.rs | Uses random_bytes for generation; zeroizes the TryFrom buffer. |
| src/signing_key/signing_key_v1.rs | Builds the Ed25519 key from OS-seeded bytes; zeroizes keypair serialization. |
| src/secret_sharing/secret_sharing_v1.rs | Zeroizes share-serialization intermediates; updates the zeroize rationale comment. |
| src/ciphertext/ciphertext_v2.rs | Switches to new_from_slice and owned XNonce for the 0.11 API. |
| src/online_ciphertext/online_ciphertext_v1.rs | Migrates STREAM types to aead-stream and OS-seeded ephemeral keys. |
| src/online_ciphertext/mod.rs | Rewrites module docs/doctests to the chunked STREAM API with valid intra-doc links. |
| src/error.rs | Retargets the AEAD error From impl to chacha20poly1305::aead::Error. |
| tests/conformity.rs | Adds a cross-version STREAM known-answer decryption vector. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fbb3f71
into
master
Wire formats are unchanged and covered by conformity vectors. Note: dalek v3 types appear in public From impls and MSRV rises to 1.85, so the Rust API is semver-breaking.