2016-12-08 05:12:00 +00:00
|
|
|
// -*- mode: rust; coding: utf-8; -*-
|
|
|
|
|
//
|
|
|
|
|
// To the extent possible under law, the authors have waived all copyright and
|
|
|
|
|
// related or neighboring rights to curve25519-dalek, using the Creative
|
|
|
|
|
// Commons "CC0" public domain dedication.
|
|
|
|
|
// See <http://creativecommons.org/publicdomain/zero/.0/> for full details.
|
|
|
|
|
//
|
|
|
|
|
// Authors:
|
|
|
|
|
// - Isis Agora Lovecruft <isis@patternsinthevoid.net>
|
|
|
|
|
// - Henry de Valence <hdevalence@hdevalence.ca>
|
|
|
|
|
|
2017-03-08 08:19:08 +00:00
|
|
|
#![cfg_attr(not(feature = "std"), no_std)]
|
|
|
|
|
#![cfg_attr(not(feature = "std"), feature(collections))]
|
2017-03-14 03:24:59 +00:00
|
|
|
#![cfg_attr(feature = "nightly", feature(i128_type))]
|
2017-03-14 01:59:08 +00:00
|
|
|
#![cfg_attr(feature = "bench", feature(test))]
|
2017-05-26 22:37:36 +00:00
|
|
|
#![cfg_attr(all(feature = "nightly", feature = "std"), feature(zero_one))]
|
2017-04-26 04:55:19 +00:00
|
|
|
|
|
|
|
|
#![allow(unused_features)]
|
2016-12-08 05:12:00 +00:00
|
|
|
#![deny(missing_docs)] // refuse to compile if documentation is missing
|
|
|
|
|
|
|
|
|
|
//! # curve25519-dalek
|
|
|
|
|
//!
|
|
|
|
|
//! **A Rust implementation of field and group operations on an Edwards curve
|
2016-12-08 21:59:52 +00:00
|
|
|
//! over GF(2^255 - 19).**
|
2016-12-08 05:12:00 +00:00
|
|
|
//!
|
|
|
|
|
//! **[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.
|
|
|
|
|
|
2017-03-14 01:59:08 +00:00
|
|
|
#[cfg(all(test, feature = "bench"))]
|
2016-12-08 05:12:00 +00:00
|
|
|
extern crate test;
|
2017-03-14 01:59:08 +00:00
|
|
|
|
2017-02-27 19:19:06 +00:00
|
|
|
#[cfg(test)]
|
|
|
|
|
extern crate sha2;
|
2016-12-08 05:12:00 +00:00
|
|
|
|
|
|
|
|
#[macro_use]
|
|
|
|
|
extern crate arrayref;
|
|
|
|
|
|
2017-02-27 19:19:06 +00:00
|
|
|
extern crate generic_array;
|
|
|
|
|
extern crate digest;
|
2017-05-31 04:37:16 +00:00
|
|
|
extern crate subtle;
|
2017-02-27 19:19:06 +00:00
|
|
|
|
2017-05-15 01:06:59 +00:00
|
|
|
#[cfg(feature = "serde")]
|
2017-05-14 05:40:51 +00:00
|
|
|
extern crate serde;
|
2017-05-15 01:06:59 +00:00
|
|
|
#[cfg(all(test, feature = "serde"))]
|
2017-05-14 05:40:51 +00:00
|
|
|
extern crate serde_cbor;
|
|
|
|
|
|
2017-03-08 08:19:08 +00:00
|
|
|
#[cfg(feature = "std")]
|
|
|
|
|
extern crate core;
|
|
|
|
|
|
2017-01-14 01:43:08 +00:00
|
|
|
#[cfg(feature = "std")]
|
2016-12-10 01:24:43 +00:00
|
|
|
extern crate rand;
|
|
|
|
|
|
2017-03-08 08:19:08 +00:00
|
|
|
#[cfg(not(feature = "std"))]
|
|
|
|
|
extern crate collections;
|
|
|
|
|
|
2016-12-08 05:12:00 +00:00
|
|
|
// Modules for low-level operations directly on field elements and curve points.
|
|
|
|
|
|
|
|
|
|
pub mod field;
|
|
|
|
|
pub mod scalar;
|
2017-02-20 07:08:52 +00:00
|
|
|
pub mod curve;
|
2017-02-20 12:04:12 +00:00
|
|
|
|
|
|
|
|
// Feature gate decaf while our implementation is unfinished and probably incorrect.
|
|
|
|
|
#[cfg(feature = "yolocrypto")]
|
2017-02-20 07:08:52 +00:00
|
|
|
pub mod decaf;
|
2016-12-08 05:12:00 +00:00
|
|
|
|
2017-05-31 04:37:16 +00:00
|
|
|
// Other miscelaneous utilities.
|
2016-12-08 05:12:00 +00:00
|
|
|
|
2017-02-21 06:06:46 +00:00
|
|
|
pub mod utils;
|
2016-12-08 05:12:00 +00:00
|
|
|
|
|
|
|
|
// Low-level curve and point constants, as well as pre-computed curve group elements.
|
|
|
|
|
|
2017-01-08 19:39:25 +00:00
|
|
|
pub mod constants;
|