diff --git a/Cargo.toml b/Cargo.toml index b57892de9..e73210010 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ name = "tari-curve25519-dalek" # - update html_root_url # - update README if required by semver # - if README was updated, also update module documentation in src/lib.rs -version = "4.0.2" +version = "4.0.3" authors = ["Isis Lovecruft ", "Henry de Valence "] readme = "README.md" @@ -31,20 +31,20 @@ features = ["nightly", "simd_backend"] travis-ci = { repository = "dalek-cryptography/curve25519-dalek", branch = "master"} [dev-dependencies] -sha2 = { version = "0.9", default-features = false } +sha2 = { version = "0.10", default-features = false } bincode = "1" criterion = { version = "0.3.0", features = ["html_reports"] } hex = "0.4.2" -rand = "0.7" +rand = "0.8" [[bench]] name = "dalek_benchmarks" harness = false [dependencies] -rand_core = { version = "0.5", default-features = false } +rand_core = { version = "0.6", default-features = false } byteorder = { version = "^1.2.3", default-features = false, features = ["i128"] } -digest = { version = "0.9", default-features = false } +digest = { version = "0.10", default-features = false } subtle = { version = "^2.2.1", default-features = false } serde = { version = "1.0", default-features = false, optional = true, features = ["derive"] } # The original packed_simd package was orphaned, see diff --git a/benches/dalek_benchmarks.rs b/benches/dalek_benchmarks.rs index 308545cb9..1d94e45e2 100644 --- a/benches/dalek_benchmarks.rs +++ b/benches/dalek_benchmarks.rs @@ -12,10 +12,10 @@ use criterion::BatchSize; use criterion::Criterion; use criterion::{BenchmarkGroup, BenchmarkId}; -extern crate curve25519_dalek; +extern crate tari_curve25519_dalek; -use curve25519_dalek::constants; -use curve25519_dalek::scalar::Scalar; +use tari_curve25519_dalek::constants; +use tari_curve25519_dalek::scalar::Scalar; static BATCH_SIZES: [usize; 5] = [1, 2, 4, 8, 16]; static MULTISCALAR_SIZES: [usize; 13] = [1, 2, 4, 8, 16, 32, 64, 128, 256, 384, 512, 768, 1024]; @@ -23,7 +23,7 @@ static MULTISCALAR_SIZES: [usize; 13] = [1, 2, 4, 8, 16, 32, 64, 128, 256, 384, mod edwards_benches { use super::*; - use curve25519_dalek::edwards::EdwardsPoint; + use tari_curve25519_dalek::edwards::EdwardsPoint; fn compress(c: &mut Criterion) { let B = &constants::ED25519_BASEPOINT_POINT; @@ -80,11 +80,11 @@ mod edwards_benches { mod multiscalar_benches { use super::*; - use curve25519_dalek::edwards::EdwardsPoint; - use curve25519_dalek::edwards::VartimeEdwardsPrecomputation; - use curve25519_dalek::traits::MultiscalarMul; - use curve25519_dalek::traits::VartimeMultiscalarMul; - use curve25519_dalek::traits::VartimePrecomputedMultiscalarMul; + use tari_curve25519_dalek::edwards::EdwardsPoint; + use tari_curve25519_dalek::edwards::VartimeEdwardsPrecomputation; + use tari_curve25519_dalek::traits::MultiscalarMul; + use tari_curve25519_dalek::traits::VartimeMultiscalarMul; + use tari_curve25519_dalek::traits::VartimePrecomputedMultiscalarMul; fn construct_scalars(n: usize) -> Vec { let mut rng = thread_rng(); @@ -247,7 +247,7 @@ mod multiscalar_benches { mod ristretto_benches { use super::*; - use curve25519_dalek::ristretto::RistrettoPoint; + use tari_curve25519_dalek::ristretto::RistrettoPoint; fn compress(c: &mut Criterion) { c.bench_function("RistrettoPoint compression", |b| { diff --git a/src/constants.rs b/src/constants.rs index 19c46e5aa..a5a0feb3e 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -16,8 +16,8 @@ //! scope using a `let` binding: //! //! ``` -//! use curve25519_dalek::constants; -//! use curve25519_dalek::traits::IsIdentity; +//! use tari_curve25519_dalek::constants; +//! use tari_curve25519_dalek::traits::IsIdentity; //! //! let B = &constants::RISTRETTO_BASEPOINT_TABLE; //! let l = &constants::BASEPOINT_ORDER; diff --git a/src/edwards.rs b/src/edwards.rs index 72477abcc..c2665d439 100644 --- a/src/edwards.rs +++ b/src/edwards.rs @@ -1139,7 +1139,7 @@ impl EdwardsPoint { /// # Example /// /// ``` - /// use curve25519_dalek::constants; + /// use tari_curve25519_dalek::constants; /// /// // Generator of the prime-order subgroup /// let P = constants::ED25519_BASEPOINT_POINT; @@ -1169,7 +1169,7 @@ impl EdwardsPoint { /// # Example /// /// ``` - /// use curve25519_dalek::constants; + /// use tari_curve25519_dalek::constants; /// /// // Generator of the prime-order subgroup /// let P = constants::ED25519_BASEPOINT_POINT; diff --git a/src/ristretto.rs b/src/ristretto.rs index a84c8cb74..370ce115f 100644 --- a/src/ristretto.rs +++ b/src/ristretto.rs @@ -486,8 +486,8 @@ impl RistrettoPoint { /// in a batch. /// /// ``` - /// # extern crate curve25519_dalek; - /// # use curve25519_dalek::ristretto::RistrettoPoint; + /// # extern crate tari_curve25519_dalek; + /// # use tari_curve25519_dalek::ristretto::RistrettoPoint; /// extern crate rand_core; /// use rand_core::OsRng; /// @@ -675,8 +675,8 @@ impl RistrettoPoint { /// # Example /// /// ``` - /// # extern crate curve25519_dalek; - /// # use curve25519_dalek::ristretto::RistrettoPoint; + /// # extern crate tari_curve25519_dalek; + /// # use tari_curve25519_dalek::ristretto::RistrettoPoint; /// extern crate sha2; /// use sha2::Sha512; /// @@ -986,8 +986,8 @@ impl RistrettoPoint { /// A precomputed table of multiples of the Ristretto basepoint is /// available in the `constants` module: /// ``` -/// use curve25519_dalek::constants; -/// use curve25519_dalek::scalar::Scalar; +/// use tari_curve25519_dalek::constants; +/// use tari_curve25519_dalek::scalar::Scalar; /// /// let a = Scalar::from(87329482u64); /// let P = &a * &constants::RISTRETTO_BASEPOINT_TABLE; @@ -1034,14 +1034,14 @@ impl ConditionallySelectable for RistrettoPoint { /// /// ``` /// # extern crate subtle; - /// # extern crate curve25519_dalek; + /// # extern crate tari_curve25519_dalek; /// # /// use subtle::ConditionallySelectable; /// use subtle::Choice; /// # - /// # use curve25519_dalek::traits::Identity; - /// # use curve25519_dalek::ristretto::RistrettoPoint; - /// # use curve25519_dalek::constants; + /// # use tari_curve25519_dalek::traits::Identity; + /// # use tari_curve25519_dalek::ristretto::RistrettoPoint; + /// # use tari_curve25519_dalek::constants; /// # fn main() { /// /// let A = RistrettoPoint::identity(); diff --git a/src/scalar.rs b/src/scalar.rs index 00de74081..82bf45b68 100644 --- a/src/scalar.rs +++ b/src/scalar.rs @@ -34,7 +34,7 @@ //! `Some(Scalar)` in return: //! //! ``` -//! use curve25519_dalek::scalar::Scalar; +//! use tari_curve25519_dalek::scalar::Scalar; //! //! let one_as_bytes: [u8; 32] = Scalar::one().to_bytes(); //! let a: Option = Scalar::from_canonical_bytes(one_as_bytes); @@ -46,7 +46,7 @@ //! (in this case, \\( \ell + 2 \\)), we'll get `None` back: //! //! ``` -//! use curve25519_dalek::scalar::Scalar; +//! use tari_curve25519_dalek::scalar::Scalar; //! //! let l_plus_two_bytes: [u8; 32] = [ //! 0xef, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, @@ -66,7 +66,7 @@ //! resultant scalar \\( \mod \ell \\), producing \\( 2 \\): //! //! ``` -//! use curve25519_dalek::scalar::Scalar; +//! use tari_curve25519_dalek::scalar::Scalar; //! //! let l_plus_two_bytes: [u8; 32] = [ //! 0xef, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, @@ -91,12 +91,12 @@ //! which allows an IUF API. //! //! ``` -//! # extern crate curve25519_dalek; +//! # extern crate tari_curve25519_dalek; //! # extern crate sha2; //! # //! # fn main() { //! use sha2::{Digest, Sha512}; -//! use curve25519_dalek::scalar::Scalar; +//! use tari_curve25519_dalek::scalar::Scalar; //! //! // Hashing a single byte slice //! let a = Scalar::hash_from_bytes::(b"Abolish ICE"); @@ -119,7 +119,7 @@ //! assurances as to reduction modulo the group order: //! //! ``` -//! use curve25519_dalek::scalar::Scalar; +//! use tari_curve25519_dalek::scalar::Scalar; //! //! let l_plus_two_bytes: [u8; 32] = [ //! 0xef, 0xd3, 0xf5, 0x5c, 0x1a, 0x63, 0x12, 0x58, @@ -509,7 +509,7 @@ impl From for Scalar { /// # Example /// /// ``` - /// use curve25519_dalek::scalar::Scalar; + /// use tari_curve25519_dalek::scalar::Scalar; /// /// let fourtytwo = Scalar::from(42u64); /// let six = Scalar::from(6u64); @@ -555,10 +555,10 @@ impl Scalar { /// /// ``` /// extern crate rand_core; - /// # extern crate curve25519_dalek; + /// # extern crate tari_curve25519_dalek; /// # /// # fn main() { - /// use curve25519_dalek::scalar::Scalar; + /// use tari_curve25519_dalek::scalar::Scalar; /// /// use rand_core::OsRng; /// @@ -581,8 +581,8 @@ impl Scalar { /// # Example /// /// ``` - /// # extern crate curve25519_dalek; - /// # use curve25519_dalek::scalar::Scalar; + /// # extern crate tari_curve25519_dalek; + /// # use tari_curve25519_dalek::scalar::Scalar; /// extern crate sha2; /// /// use sha2::Sha512; @@ -611,8 +611,9 @@ impl Scalar { /// # Example /// /// ``` - /// # extern crate curve25519_dalek; - /// # use curve25519_dalek::scalar::Scalar; + /// # extern crate tari_curve25519_dalek; + /// # use tari_curve25519_dalek::scalar::Scalar; + /// # use tari_curve25519_dalek::digest::Update; /// extern crate sha2; /// /// use sha2::Digest; @@ -649,7 +650,7 @@ impl Scalar { /// # Example /// /// ``` - /// use curve25519_dalek::scalar::Scalar; + /// use tari_curve25519_dalek::scalar::Scalar; /// /// let s: Scalar = Scalar::zero(); /// @@ -664,7 +665,7 @@ impl Scalar { /// # Example /// /// ``` - /// use curve25519_dalek::scalar::Scalar; + /// use tari_curve25519_dalek::scalar::Scalar; /// /// let s: Scalar = Scalar::zero(); /// @@ -704,7 +705,7 @@ impl Scalar { /// # Example /// /// ``` - /// use curve25519_dalek::scalar::Scalar; + /// use tari_curve25519_dalek::scalar::Scalar; /// /// // x = 2238329342913194256032495932344128051776374960164957527413114840482143558222 /// let X: Scalar = Scalar::from_bytes_mod_order([ @@ -748,8 +749,8 @@ impl Scalar { /// # Example /// /// ``` - /// # extern crate curve25519_dalek; - /// # use curve25519_dalek::scalar::Scalar; + /// # extern crate tari_curve25519_dalek; + /// # use tari_curve25519_dalek::scalar::Scalar; /// # fn main() { /// let mut scalars = [ /// Scalar::from(3u64), @@ -1113,9 +1114,9 @@ impl Scalar { /// This is intended for uses like input validation, where variable-time code is acceptable. /// /// ``` - /// # extern crate curve25519_dalek; + /// # extern crate tari_curve25519_dalek; /// # extern crate subtle; - /// # use curve25519_dalek::scalar::Scalar; + /// # use tari_curve25519_dalek::scalar::Scalar; /// # use subtle::ConditionallySelectable; /// # fn main() { /// // 2^255 - 1, since `from_bits` clears the high bit diff --git a/src/traits.rs b/src/traits.rs index 20529a9df..c0af8db3b 100644 --- a/src/traits.rs +++ b/src/traits.rs @@ -84,10 +84,10 @@ pub trait MultiscalarMul { /// iterators returning either `Scalar`s or `&Scalar`s. /// /// ``` - /// use curve25519_dalek::constants; - /// use curve25519_dalek::traits::MultiscalarMul; - /// use curve25519_dalek::ristretto::RistrettoPoint; - /// use curve25519_dalek::scalar::Scalar; + /// use tari_curve25519_dalek::constants; + /// use tari_curve25519_dalek::traits::MultiscalarMul; + /// use tari_curve25519_dalek::ristretto::RistrettoPoint; + /// use tari_curve25519_dalek::scalar::Scalar; /// /// // Some scalars /// let a = Scalar::from(87329482u64); @@ -136,10 +136,10 @@ pub trait VartimeMultiscalarMul { /// inlining point decompression into the multiscalar call, /// avoiding the need for temporary buffers. /// ``` - /// use curve25519_dalek::constants; - /// use curve25519_dalek::traits::VartimeMultiscalarMul; - /// use curve25519_dalek::ristretto::RistrettoPoint; - /// use curve25519_dalek::scalar::Scalar; + /// use tari_curve25519_dalek::constants; + /// use tari_curve25519_dalek::traits::VartimeMultiscalarMul; + /// use tari_curve25519_dalek::ristretto::RistrettoPoint; + /// use tari_curve25519_dalek::scalar::Scalar; /// /// // Some scalars /// let a = Scalar::from(87329482u64); @@ -199,10 +199,10 @@ pub trait VartimeMultiscalarMul { /// iterators returning either `Scalar`s or `&Scalar`s. /// /// ``` - /// use curve25519_dalek::constants; - /// use curve25519_dalek::traits::VartimeMultiscalarMul; - /// use curve25519_dalek::ristretto::RistrettoPoint; - /// use curve25519_dalek::scalar::Scalar; + /// use tari_curve25519_dalek::constants; + /// use tari_curve25519_dalek::traits::VartimeMultiscalarMul; + /// use tari_curve25519_dalek::ristretto::RistrettoPoint; + /// use tari_curve25519_dalek::scalar::Scalar; /// /// // Some scalars /// let a = Scalar::from(87329482u64);