Skip to content

chore(deps): upgrade RustCrypto stack to latest versions#25

Open
zonyitoo wants to merge 1 commit into
mainfrom
chore/upgrade-dependencies
Open

chore(deps): upgrade RustCrypto stack to latest versions#25
zonyitoo wants to merge 1 commit into
mainfrom
chore/upgrade-dependencies

Conversation

@zonyitoo
Copy link
Copy Markdown
Collaborator

@zonyitoo zonyitoo commented May 1, 2026

Summary

Upgrade all cryptography dependencies to their latest versions and migrate the codebase to the new RustCrypto 0.11 ecosystem APIs.

Dependency updates

Crate Old New
aes-gcm 0.10 0.11.0-rc.3
aes-gcm-siv 0.11 0.12.0-rc.3
ccm 0.5 0.6.0-rc.3
chacha20poly1305 0.10 0.11.0-rc.3
aead 0.5 0.6.0-rc.10
aes 0.8 0.9
chacha20 0.9 0.10
ctr 0.9 0.10
camellia 0.1 0.2
sm4 0.5 0.6
ghash 0.5 0.6
subtle 2.5 2.6
bytes 1.3 1.11
blake3 1.3 1.8

The AEAD crates remain on their 0.11 release candidates because the current stable 0.10 line still pins aes 0.8 and ghash 0.5, which would conflict with the upgraded block/universal-hash stack. Moving the entire stack together keeps dependency resolution clean.

API migration

  • Replace aead::generic_array with aead::array (hybrid-array)
  • Replace AeadInPlace with AeadInOutencrypt_inout_detached / decrypt_inout_detached now take an InOutBuf
  • Update the SM4-GCM custom AeadCore impl: drop CiphertextOverhead, add the new TAG_POSITION associated constant
  • Replace deprecated Array::from_slice / from_mut_slice with TryFrom
  • Rename cipher::{BlockEncrypt, BlockDecrypt} imports to their BlockCipher{Encrypt,Decrypt} counterparts
  • Import Unsigned from typenum (cipher::typenum / aead::array::typenum) since the re-export at cipher::Unsigned was removed
  • Use cipher::Iv for ChaCha20 nonce (chacha20::Nonce is no longer re-exported)

Also bumps rust-version to 1.85 to match the MSRV of the new RustCrypto crates.

Verification

  • cargo build --features "v1-stream v1-aead-extra v2-extra" — 0 errors, 0 warnings
  • cargo test --features "v1-stream v1-aead-extra v2-extra" — 25/25 passing
  • cargo test --features "v1-stream v1-aead-extra v2-extra aws-lc" — 25/25 passing

Note

The pre-existing ring feature remains broken (the ring branch in aes_gcm.rs and chacha20_poly1305.rs declares helper traits but never exposes the Aes128Gcm / Aes256Gcm / ChaCha20Poly1305 structs). This bug existed before this PR and is unrelated to the dependency upgrade.

Upgrade all cryptography dependencies to their latest versions and
migrate the codebase to the new RustCrypto 0.11 ecosystem APIs.

Dependency updates:
- aes-gcm 0.10 -> 0.11.0-rc.3
- aes-gcm-siv 0.11 -> 0.12.0-rc.3
- ccm 0.5 -> 0.6.0-rc.3
- chacha20poly1305 0.10 -> 0.11.0-rc.3
- aead 0.5 -> 0.6.0-rc.10
- aes 0.8 -> 0.9
- chacha20 0.9 -> 0.10
- ctr 0.9 -> 0.10
- camellia 0.1 -> 0.2
- sm4 0.5 -> 0.6
- ghash 0.5 -> 0.6
- subtle 2.5 -> 2.6
- bytes 1.3 -> 1.11
- blake3 1.3 -> 1.8

The AEAD crates remain on their 0.11 rc releases because the stable
0.10 line still pins aes 0.8 and ghash 0.5, which would conflict with
the upgraded block/universal-hash stack.

API migration:
- Replace aead::generic_array with aead::array (hybrid-array)
- Replace AeadInPlace with AeadInOut (encrypt_inout_detached /
  decrypt_inout_detached take InOutBuf)
- Update AeadCore impl for SM4-GCM: drop CiphertextOverhead, add
  TAG_POSITION constant
- Replace deprecated Array::from_slice / from_mut_slice with TryFrom
- Rename cipher::{BlockEncrypt, BlockDecrypt} imports to their
  BlockCipher{Encrypt,Decrypt} counterparts
- Import Unsigned from typenum (cipher::typenum / aead::array::typenum)
- Use cipher::Iv for chacha20 nonce (Nonce is no longer re-exported)

Also bump rust-version to 1.85 to match the MSRV of the new
RustCrypto crates.
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