Move from ring to rind
This page describes rind-ring as main has it, ahead of rind-ring 0.17.3 on crates.io. Until its next release, take it from git at the commit this page describes. Beside the lines below, add this line under the [patch.crates-io] table of your workspace's root Cargo.toml (add the table if it has none), then run cargo update -p rind-ring:
rind-ring = { git = "https://github.com/kixel-ai/rind", rev = "80fc7ba544b53a6ca9ab21ba9a946c275eb19a06" }That moves every crate in your tree that depends on rind-ring, and cargo tree -i rind-ring then shows it from git+https://github.com/kixel-ai/rind.
This crate offers ring 0.17's API, name for name, backed by rind, a fork of Graviola. A crate on ring swaps it in by renaming its dependency, with no code changes:
[dependencies]
ring = { package = "rind-ring", version = "0.17" }Every ring feature is accepted. As in ring, alloc gates RSA, std the
errors' std::error::Error impls, and wasm32_unknown_unknown_js the
browser's random source (see WebAssembly); the rest change
nothing.
The rename reaches only the crate that makes it. A binary moves every crate
in its tree on ring 0.17 to rind, including dependencies that name ring such
as rustls and quinn-proto on their ring features, by patching ring in its
workspace's root Cargo.toml and then running cargo update -p ring:
[patch.crates-io]
ring = { git = "https://github.com/kixel-ai/rind-patch" }Cargo builds the crate named ring in
rind-patch, a small repository of
its own, which re-exports rind-ring and accepts every ring feature.
crates.io has the name, so that crate is never published. Its version, 0.17.999, meets every ring
0.17 requirement. Where the patch is not used, such as for an exact
requirement like =0.17.14 or before the lockfile is updated, Cargo builds
crates.io's ring and only warns, so check that cargo tree -i ring prints
ring v0.17.999 from rind-patch alone. A dependency on ring 0.16 or
older keeps it, and a library cannot patch for the binaries that use it,
since Cargo applies a patch only in the workspace that declares it.
rind-ring panics wherever ring panics, such as pbkdf2::derive on an
output over (2^32 - 1) hash outputs, so its signatures match ring's
exactly (maintainer, 2026-10-31). rind itself never panics on caller
input.
What rind cannot back
These items are not offered, so code using them, in a patched dependency too, fails to build:
aead::chacha20_poly1305_openssh: rind refuses it, having no SSH consumer.rsa::KeyPairComponentsandrsa::KeyPair::from_components: building a key from components means encoding its secret parts as DER, which branches on their leading bytes. Load the key as PKCS#1 or PKCS#8.io,test,deprecated_test, andtest_file!: ring's DER reader and test harness, which are no cryptography.test::rand's fixed random sources could not work, since rind draws its own randomness.signature::RsaEncoding::encode: ring's hidden, deprecated internal method, which takes a type callers cannot name.
Behaves differently
- Where ring takes a
rand::SecureRandomto generate a key or sign, rind draws from the system random source itself, asrand::SystemRandom, the onlySecureRandom, does. - An Ed25519 public key of small order verifies no signature, where ring verifies some that nobody made on it.
- A secret or private key wipes its memory on drop, which ring never does; a public key on its own is not wiped.
- A
error::KeyRejected'sDisplaygives rind's reason, not ring's name for it, which ring documents as changing between releases.
WebAssembly
rind-ring builds for wasm32-wasip2, where CI runs its tests under wasmtime,
and for wasm32-unknown-unknown, the browser, where its
wasm32_unknown_unknown_js feature takes the JavaScript random source, as
ring's does. Neither needs the C compiler targeting wasm that ring needs.
rind's constant-time checks do not cover wasm; PLATFORMS.md says why.
Switch with an agent
Paste this into your coding agent, in your repository:
Move this repository from ring or aws-lc-rs to rind, following
https://raw.githubusercontent.com/kixel-ai/rind/main/MIGRATE.mdIt migrates on a local branch, reports the build time, binary size, benchmarks, and tests before and after, and asks before opening a PR or filing an issue. To migrate by hand, MIGRATING.md maps each ring and aws-lc-rs item to rind's.