Crate curve25519_dalek [−] [src]
A pure-Rust implementation of group operations on Ristretto and Curve25519.
curve25519-dalek is a library providing group operations on the Edwards and
Montgomery forms of Curve25519, and on the prime-order Ristretto group.
curve25519-dalek is not intended to provide implementations of any particular
crypto protocol. Rather, implementations of those protocols (such as
ed25519-dalek) should use
curve25519-dalek as a library.
curve25519-dalek is intended to provide a clean and safe mid-level API for use
implementing a wide range of ECC-based crypto protocols, such as key agreement,
signatures, anonymous credentials, rangeproofs, and zero-knowledge proof
curve25519-dalek implements Ristretto, which constructs a
prime-order group from a non-prime-order Edwards curve. This provides the
speed and safety benefits of Edwards curve arithmetic, without the pitfalls of
cofactor-related abstraction mismatches.
We do not yet consider this code to be production-ready. We intend to
stabilize a production-ready version
curve25519-dalek documentation requires a custom HTML header to include
KaTeX for math support. Unfortunately
cargo doc does not currently support
this, but docs can be built using
make doc make doc-internal
curve25519-dalek, add the following to the dependencies section of
curve25519-dalek = "^0.16"
Then import the crate as:
extern crate curve25519_dalek;
Curve arithmetic is implemented using one of the following backends:
u128products, available using the
- an experimental AVX2 backend, available using the
yolocryptofeature when compiling for a target with
Benchmarks are run using
cargo bench # u32 backend cargo bench --features="nightly" # u64 backend cargo bench --features="nightly yolocrypto" # u64 or avx2 if available
yolocrypto feature enables experimental features. The name
is meant to indicate that it is not considered production-ready, and we do not
yolocrypto features to be covered by semver guarantees.
Please see CONTRIBUTING.md.
Patches and pull requests should be make against the
SPOILER ALERT: The Twelfth Doctor's first encounter with the Daleks is in his second full episode, "Into the Dalek". A beleaguered ship of the "Combined Galactic Resistance" has discovered a broken Dalek that has turned "good", desiring to kill all other Daleks. The Doctor, Clara and a team of soldiers are miniaturized and enter the Dalek, which the Doctor names Rusty. They repair the damage, but accidentally restore it to its original nature, causing it to go on the rampage and alert the Dalek fleet to the whereabouts of the rebel ship. However, the Doctor manages to return Rusty to its previous state by linking his mind with the Dalek's: Rusty shares the Doctor's view of the universe's beauty, but also his deep hatred of the Daleks. Rusty destroys the other Daleks and departs the ship, determined to track down and bring an end to the Dalek race.
curve25519-dalek is authored by Isis Agora Lovecruft and Henry de Valence.
Portions of this library were originally a port of Adam Langley's
Golang ed25519 library, which was in
turn a port of the reference
u64 scalar arithmetic was implemented by Andrew Moon, and
the addition chain for scalar inversion was provided by Brian Smith.
no_std support was contributed by Tony Arcieri.
Thanks also to Ashley Hauck, Lucas Salibian, and Manish Goregaokar for their contributions.
Note that docs will only build on nightly Rust until RFC 1990 stabilizes.
Various constants, such as the Ristretto and Ed25519 basepoints.
Group operations for Curve25519, in Edwards form.
Scalar multiplication on the Montgomery form of Curve25519.
An implementation of Ristretto, which provides a prime-order group.
Arithmetic on scalars (integers mod the group order).
Module for common traits.