Skip to content

Update crypto dependencies to chacha20poly1305 0.11 and dalek v3#408

Merged
Mathieu Morrissette (mmorrissette-devolutions) merged 1 commit into
masterfrom
update-crypto-deps
Jul 7, 2026
Merged

Update crypto dependencies to chacha20poly1305 0.11 and dalek v3#408
Mathieu Morrissette (mmorrissette-devolutions) merged 1 commit into
masterfrom
update-crypto-deps

Conversation

@mmorrissette-devolutions

Copy link
Copy Markdown
Contributor
  • chacha20poly1305 0.10 -> 0.11, ed25519-dalek 2 -> 3, x25519-dalek 2 -> 3, STREAM now from the aead-stream crate (removed from aead 0.6)
  • private keys are now generated directly from the OS CSPRNG
  • zeroize hardening: cipher key schedule (chacha20poly1305/zeroize), secret shares (blahaj/zeroize_memory), serialization intermediates
  • online_ciphertext doctests now use the STREAM API
  • added a cross-version STREAM conformity vector

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.

- 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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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 to new_from_slice(...) and error/From plumbing to chacha20poly1305::aead::Error.
  • Added utils::random_bytes::<N>() -> Zeroizing<[u8; N]> and routed all private-key/ephemeral-key generation through it (plus additional Zeroizing of serialization intermediates and secret shares).
  • Rewrote the online_ciphertext module 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.

@mmorrissette-devolutions Mathieu Morrissette (mmorrissette-devolutions) merged commit fbb3f71 into master Jul 7, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants