Skip to main content

Crate ring

Crate ring 

Source
Expand description

A drop-in replacement for ring 0.17, implemented with scytale.

This crate presents the public interface of ring 0.17, and does the work with scytale. It is not a fork: no line of ring’s implementation is here, and there is no C or assembly to build. Code written against ring compiles against it unchanged, because the library is named ring.

This release presents ring 0.17’s API, checked against ring 0.17.14, and is tested with rustls 0.23.45 and rustls-webpki 0.103.15. The version number is this crate’s own, not ring’s; the README keeps a table of which ring each release presents.

Switch a crate over in its own manifest:

[dependencies]
ring = { package = "scytale-ring", version = "0.10" }

That reaches the crate whose manifest it is. It cannot reach a dependency that names ring itself: cargo’s [patch] matches a replacement by its real package name, which this is not.

§Where it differs from ring

ECDSA signatures are deterministic here (RFC 6979), where ring draws a random nonce. Both verify against the other, and the random source ring asks for is accepted and not used, but a test that compares signature bytes with stored ones will not match.

The minimum Rust is scytale’s, 1.88, where ring’s is 1.66.

Modules§

aead
Authenticated encryption: AES-GCM and ChaCha20-Poly1305.
agreement
Ephemeral key agreement: X25519, and ECDH over P-256 and P-384.
digest
Hashes: SHA-1 for old protocols, and SHA-2.
error
The two errors ring reports.
hkdf
HKDF (RFC 5869), extract and expand as separate steps.
hmac
HMAC over the hashes in digest.
io
Reading DER, for callers that pick a structure apart themselves.
pbkdf2
PBKDF2 (RFC 8018), over the HMACs in hmac.
pkcs8
PKCS#8 documents a key pair is generated into.
rand
Random bytes, from the system.
rsa
RSA signatures: PKCS#1 v1.5 and PSS.
signature
Signatures: Ed25519, ECDSA over P-256 and P-384, and RSA.

Macros§

test_file
A vector file for [test::run], read at compile time.