Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
wolfcrypt-ring-compat
API-compatible replacement for the ring
crate, backed by wolfCrypt instead of BoringSSL. Exports
lib.name = "ring" so downstream code keeps use ring::... unchanged.
Why
ring is widely used by rustls, AWS SDKs, and other foundational Rust
crates, but it is not FIPS 140-3 certifiable.
wolfcrypt-ring-compat provides the same API surface with a
FIPS-validatable backend:
- Drop-in replacement — exports
lib.name = "ring", so downstream code keepsuse ring::...unchanged. Swap the dependency via[patch.crates-io]and rebuild. - FIPS 140-3 — wolfCrypt is FIPS 140-3 validated; this is the
migration path if your project uses
ring's API and needs a FIPS-certifiable backend (contact wolfSSL for the commercial FIPS license and validated source). - Broad coverage — targets API parity with
ring 0.17: AES-GCM, ChaCha20-Poly1305, ECDH (P-256, P-384, X25519), SHA-{1, 256, 384, 512}, HMAC, HKDF, PBKDF2, ECDSA, Ed25519, RSA PKCS#1 v1.5 and PSS, andSystemRandom. - Single crypto stack — every algorithm above goes through wolfCrypt rather than a mix of pure-Rust and assembly backends.
Usage
[]
= "1.16"
# Redirect transitive deps that ask for upstream `ring`:
[]
= { = "wolfcrypt-ring-compat", = "1.16" }
use ;
let key_bytes = ;
let nonce_bytes = ;
let unbound = new?;
let key = new;
let mut in_out = b"plaintext".to_vec;
key.seal_in_place_append_tag?;
Do not pull in both
ringandwolfcrypt-ring-compatin the same dependency tree. They export the same Rust library name (ring) and will collide at link time. Use the[patch.crates-io]snippet above to redirect any transitiveringdependency to this crate.
How it works
wolfssl-src Compiles wolfSSL/wolfCrypt C source via the cc crate
│
wolfcrypt-sys bindgen FFI + cargo cfg flags per compiled algorithm
│
wolfcrypt-rs Typed Rust FFI wrapper
│
wolfcrypt-ring-compat ring-compatible API surface ← this crate
lib.name = "ring"
The crate is organised module-for-module against upstream ring:
aead, agreement, cipher, digest, ec, ed25519, hkdf, hmac,
pbkdf2, rand, rsa, signature, plus io and error. Each
module forwards to the corresponding wolfcrypt-rs API instead of
BoringSSL.
| Feature | Default | Description |
|---|---|---|
alloc |
yes | Allow allocation of arbitrary-sized values. Required by io::writer. (Semantics differ from upstream ring's alloc feature.) |
std |
yes | Standard library support; depends on alloc. |
ring-io |
yes | Enable the io module. |
ring-sig-verify |
yes | Preserve compatibility with ring::signature::VerificationAlgorithm::verify; pulls in untrusted = "0.7.1". |
fips |
no | Build wolfcrypt-rs against the FIPS 140-3 validated wolfSSL source module. Requires WOLFSSL_FIPS_SOURCE_DIR and a wolfSSL commercial FIPS license. |
non-fips |
no | Compile-time guarantee that the non-FIPS wolfcrypt-rs is used. Mutually exclusive with fips. |
fips and non-fips are mutually exclusive — enabling both produces
a compile-time error. Additional build-time features (bindgen,
prebuilt-nasm, asan, dev-tests-only, unstable) are documented
in the crate-level rustdoc.
References
ring— upstream crate this is API-compatible with- wolfCrypt — cryptographic backend
- wolfcrypt-rs — typed Rust FFI wrapper used by every module in this crate
- wolfcrypt-sys — bindgen-generated FFI bindings
- wolfssl-src — wolfSSL C source build
- wolfcrypt-ring-testing — tests and benchmarks for this crate
- RFC 5116 — AEAD interface (AES-GCM, ChaCha20-Poly1305)
- RFC 8439 — ChaCha20 and Poly1305 for IETF protocols
- RFC 7748 — X25519 elliptic-curve Diffie-Hellman
- RFC 8032 — Ed25519 / EdDSA signatures
- RFC 6979 — Deterministic ECDSA
- RFC 8017 — RSA PKCS#1 v2.2 (signatures and OAEP)
- RFC 5869 — HKDF
- RFC 2104 — HMAC
- RFC 8018 — PBKDF2
- wolfSSL documentation
- workspace README
Copyright
Copyright (C) 2006-2026 wolfSSL Inc.
Portions of this crate are derived from
ring, copyright Brian Smith and
the ring contributors (ISC license), and from AWS-LibCrypto.
License
GPL-3.0-only OR LicenseRef-wolfSSL-commercial.
The underlying wolfSSL C library is licensed under GPL-3.0-or-later with a commercial option available from wolfSSL Inc.