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

# Run openmls on rind

rind-openmls is unreleased: this page describes it as `main` has it. Until its first 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-openmls`:

```toml
rind-openmls = { git = "https://github.com/kixel-ai/rind", rev = "80fc7ba544b53a6ca9ab21ba9a946c275eb19a06" }
```

That moves every crate in your tree that depends on rind-openmls, and `cargo tree -i rind-openmls` then shows it from `git+https://github.com/kixel-ai/rind`.

This crate provides a crypto provider for [OpenMLS](https://github.com/openmls/openmls), backed by [rind](https://github.com/kixel-ai/rind/), a fork of [Graviola](https://github.com/ctz/graviola/).

It offers exactly the API of [openmls_rust_crypto](https://docs.rs/openmls_rust_crypto), item for item, so replacing that dependency and its `use` lines is the whole migration:

```toml
[dependencies]
# In place of openmls_rust_crypto = "0.6".
rind-openmls = "0.6"
```

```rust
use rind_openmls::OpenMlsRustCrypto;

let provider = OpenMlsRustCrypto::default();
```

It offers the ciphersuites openmls_rust_crypto does: `MLS_128_DHKEMX25519_AES128GCM_SHA256_Ed25519`, `MLS_128_DHKEMX25519_CHACHA20POLY1305_SHA256_Ed25519`, and `MLS_128_DHKEMP256_AES128GCM_SHA256_P256`.
It signs and verifies with Ed25519 and ECDSA on P-256 and P-384, seals HPKE to X25519, P-256, and P-384, and draws randomness from the system's source.

## What rind cannot back

- The X448 and Ed448 ciphersuites, which openmls_rust_crypto lacks too.
- The P-384 and P-521 ciphersuites, which openmls_rust_crypto lacks too. rind has their primitives, so they come once openmls_rust_crypto offers them or fixed test vectors can validate them: the MLS test vectors give some P-521 private keys without their leading zero ([mlswg/mls-implementations#176](https://github.com/mlswg/mls-implementations/issues/176)), and openmls's copy of the crypto-basics vectors signs both suites over SHA-256.
- The `draft-ietf-mls-pq-ciphersuites` feature: rind's HPKE has no post-quantum KEM yet.
- The `targeted-messages-draft` feature: rind's HPKE has no PSK mode.
- The `virtual-clients-draft` feature: rind has no FF1.

Naming one of those features fails to resolve, and turning on openmls's own `targeted-messages-draft` or `virtual-clients-draft` fails to compile this crate, rather than failing at run time.

## WebAssembly

It builds for `wasm32-wasip2` and `wasm32-unknown-unknown`, the browser, where
rind needs its JavaScript random source, `getrandom = { version = "0.4",
features = ["wasm_js"] }`. [PLATFORMS.md](https://github.com/kixel-ai/rind/blob/main/PLATFORMS.md) lists what each adapter's
upstream needs there too, and why rind's constant-time checks do not cover wasm.

## 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

- [ring](/from/ring)
- [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)
- [Crates with their own crypto backend](/from)
