Skip to content

chore(deps): migrate off deprecated generic-array to hybrid-array majors - #146

Open
prestwich wants to merge 1 commit into
mainfrom
prestwich/hybrid-array-migration
Open

chore(deps): migrate off deprecated generic-array to hybrid-array majors#146
prestwich wants to merge 1 commit into
mainfrom
prestwich/hybrid-array-migration

Conversation

@prestwich

Copy link
Copy Markdown
Member

Summary

generic-array released a 1.x major, but RustCrypto's own crates (digest, crypto-common, sha2, sha3, ripemd, hmac, pbkdf2) skipped it entirely and moved to a sister crate, hybrid-array, instead. Bumping our direct generic-array dependency alone (as done reactively in c1b9680) doesn't clear anything — it just adds a second, incompatible major version to the tree while the real hashing types stay on the deprecated 0.14 line underneath.

This bumps the whole chain together onto their hybrid-array-based majors:

  • digest 0.10→0.11, sha2 0.10→0.11, sha3 0.10→0.12, ripemd 0.1→0.2, hmac 0.12→0.13, pbkdf2 0.12→0.13, k256 0.13→0.14
  • coins-core's GenericArray re-export now points at hybrid_array::Array (drops the #[allow(deprecated)] shim)
  • k256 0.14 pulls in ecdsa 0.17/signature 3.0, which redesigned DigestSigner/DigestVerifier to take a closure over the hasher rather than a finalized digest value — updated inherit_signer!/inherit_verifier! in bip32 and all call sites (tests + the crate-level doc example)
  • elliptic_curve::sec1::{FromEncodedPoint, ToEncodedPoint} are now deprecated stub traits; switched to FromSec1Point/ToSec1Point
  • MSRV 1.80→1.85 (required by k256 0.14)
  • pinned getrandom 0.4 with wasm_js for wasm32 targets, following the existing gr03/gr02 shim pattern, since crypto-bigint/crypto-common now pull it in transitively

Breaking changes

  • coins_core::hashes::GenericArray is now hybrid_array::Array rather than generic_array::GenericArray
  • DigestSigner/DigestVerifier impls in coins-bip32 (sign_digest, try_sign_digest, verify_digest) take a closure Fn(&mut D) -> ... instead of a finalized digest value
  • MSRV raised to 1.85

Test plan

All 5 CI jobs verified locally:

  • cargo test (default features)
  • cargo test --no-default-features
  • RUSTFLAGS='--cfg getrandom_backend="wasm_js"' cargo check --target wasm32-unknown-unknown --no-default-features --features browser
  • cargo clippy --workspace --all-targets with -D warnings
  • cargo fmt --all --check
  • cargo +nightly doc --workspace --no-deps --document-private-items with -D warnings

🤖 Generated with Claude Code

digest/sha2/sha3/ripemd/hmac/pbkdf2/k256 all moved from generic-array
0.14 to hybrid-array 0.4 in their latest majors, so bumping generic-array
alone (as in c1b9680) can't actually clear the deprecation - it just
adds a second, unrelated major version to the tree. Bump the whole
RustCrypto chain together instead:

- digest 0.10->0.11, sha2 0.10->0.11, sha3 0.10->0.12, ripemd 0.1->0.2,
  hmac 0.12->0.13, pbkdf2 0.12->0.13, k256 0.13->0.14
- coins-core's GenericArray re-export now points at hybrid_array::Array
- k256 0.14 pulls ecdsa 0.17/signature 3.0, which redesigned
  DigestSigner/DigestVerifier to take a closure over the hasher instead
  of a finalized digest value; updated inherit_signer!/inherit_verifier!
  and all call sites accordingly
- elliptic_curve::sec1::{FromEncodedPoint,ToEncodedPoint} are now
  deprecated stub traits; switched to FromSec1Point/ToSec1Point
- MSRV 1.80->1.85 (k256 0.14 requires it)
- pinned getrandom 0.4 w/ wasm_js for wasm32, matching the existing
  gr03/gr02 shims, since crypto-bigint/crypto-common now pull it in

Verified locally: cargo test (default + --no-default-features), wasm
check, clippy -D warnings, fmt --check, and nightly doc -D warnings all
pass.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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