Skip to content

Update crypto#2437

Open
zancas wants to merge 2 commits into
devfrom
update_crypto
Open

Update crypto#2437
zancas wants to merge 2 commits into
devfrom
update_crypto

Conversation

@zancas

@zancas zancas commented Jul 6, 2026

Copy link
Copy Markdown
Member

ring is unmaintained.

aws-lc-rs is supported by the community, including for post-quantum security.

This change opts to use aws-lc-rs as the provider, while permitting downstream consumer to selects their own per-process provider. If they don't provide one aws-lc-rs is the default.

zancas and others added 2 commits July 5, 2026 20:39
…ange

Follows the CryptoProvider pattern established in zaino:
zingolabs/zaino@a62dcd3

rustls 0.23 auto-selects a provider only when exactly one of its ring /
aws_lc_rs features is enabled. The workspace pinned rustls with the ring
feature while rustls's default features already enable aws-lc-rs, so
feature unification put both providers in the graph and nothing installed
a process-level default - four zingo-netutils tests panicked with "Could
not automatically determine the process-level CryptoProvider".

Changes:

- zingo-netutils gains crypto::ensure_default_crypto_provider(): a
  guarded, first-install-wins install of aws-lc-rs, called where the
  crate builds rustls configs. An embedder (e.g. zingo-mobile) that
  installs its own provider first keeps it. Re-exported through zingolib.
- The seven scattered ad-hoc ring provider installs (LightClient
  constructors, sync_example_wallet, zingo-cli main, libtonode tests)
  are replaced with that one helper.
- Workspace features: rustls drops ring and gains prefer-post-quantum
  (the X25519MLKEM768 hybrid group leads outbound handshakes; ML-KEM is
  only available on aws-lc-rs); hyper-rustls and tokio-rustls switch
  ring -> aws-lc-rs; tonic gains tls-aws-lc so the provider is asserted
  in the feature graph rather than inherited.
- zingo-price: reqwest switches to rustls-tls-no-provider (never
  auto-selects) and installs the provider before fetching; it sits below
  zingo-netutils in the graph, so it carries a mirrored helper.
- Real crypto use excised: the legacy BIP32 HMAC-SHA512 derivation in
  extended_transparent.rs moves from ring::hmac to the RustCrypto
  hmac + sha2 crates. The stored-wallet regression tests
  (verify_example_wallet_*) confirm derivation is unchanged.
- The ring and rustls dependencies are dropped from zingolib, zingo-cli,
  and libtonode-tests; ring leaves the workspace dependency table.
- zcash_proofs's download-params feature (whose minreq -> rustls 0.21 ->
  ring subtree is the sole ring residue) is now enabled only for the
  build script that fetches sapling params; the runtime dependency graph
  is 100% aws-lc-rs.

Verified: the four previously failing zingo-netutils tests pass
(including the live mainnet-indexer connect); 95/95 unit tests across
zingo-netutils, zingo-price, and zingolib; cargo clippy clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
(cherry picked from commit de11e16)
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