[migrating]: https://github.com/kixel-ai/rind/blob/main/MIGRATING.md

# Move from ring to rind

This page describes rind-ring as `main` has it, ahead of [rind-ring 0.17.3](https://crates.io/crates/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`:

```toml
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](https://github.com/briansmith/ring) 0.17's API, name for name, backed by [rind](https://github.com/kixel-ai/rind/), a fork of [Graviola](https://github.com/ctz/graviola/).
A crate on ring swaps it in by renaming its dependency, with no code
changes:

```toml
[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](#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`:

```toml
[patch.crates-io]
ring = { git = "https://github.com/kixel-ai/rind-patch" }
```

Cargo builds the crate named `ring` in
[rind-patch](https://github.com/kixel-ai/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::KeyPairComponents` and `rsa::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`, and `test_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::SecureRandom` to generate a key or sign,
  rind draws from the system random source itself, as
  `rand::SystemRandom`, the only `SecureRandom`, 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`'s `Display` gives 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](https://github.com/kixel-ai/rind/blob/main/PLATFORMS.md) says why.

## Switch with an agent

Paste this into your coding agent, in your repository:

```text
Move this repository from ring or aws-lc-rs to rind, following
https://raw.githubusercontent.com/kixel-ai/rind/main/MIGRATE.md
```

It 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][migrating] maps each
ring and aws-lc-rs item to rind's.

## Other libraries

- [aws-lc-rs](/from/aws-lc-rs)
- [rustls](/from/rustls)
- [rcgen](/from/rcgen)
- [jsonwebtoken](/from/jsonwebtoken)
- [dimpl](/from/dimpl)
- [str0m](/from/str0m)
- [object_store](/from/object_store)
- [openmls](/from/openmls)
- [Crates with their own crypto backend](/from)
