Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update dependencies #2

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>",
"Henry de Valence <[email protected]>"]
readme = "README.md"
Expand All @@ -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
Expand Down
20 changes: 10 additions & 10 deletions benches/dalek_benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@ 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];

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;
Expand Down Expand Up @@ -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<Scalar> {
let mut rng = thread_rng();
Expand Down Expand Up @@ -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| {
Expand Down
4 changes: 2 additions & 2 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/edwards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
20 changes: 10 additions & 10 deletions src/ristretto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
///
Expand Down Expand Up @@ -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;
///
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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();
Expand Down
41 changes: 21 additions & 20 deletions src/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> = Scalar::from_canonical_bytes(one_as_bytes);
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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::<Sha512>(b"Abolish ICE");
Expand All @@ -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,
Expand Down Expand Up @@ -509,7 +509,7 @@ impl From<u64> for Scalar {
/// # Example
///
/// ```
/// use curve25519_dalek::scalar::Scalar;
/// use tari_curve25519_dalek::scalar::Scalar;
///
/// let fourtytwo = Scalar::from(42u64);
/// let six = Scalar::from(6u64);
Expand Down Expand Up @@ -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;
///
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -649,7 +650,7 @@ impl Scalar {
/// # Example
///
/// ```
/// use curve25519_dalek::scalar::Scalar;
/// use tari_curve25519_dalek::scalar::Scalar;
///
/// let s: Scalar = Scalar::zero();
///
Expand All @@ -664,7 +665,7 @@ impl Scalar {
/// # Example
///
/// ```
/// use curve25519_dalek::scalar::Scalar;
/// use tari_curve25519_dalek::scalar::Scalar;
///
/// let s: Scalar = Scalar::zero();
///
Expand Down Expand Up @@ -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([
Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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
Expand Down
24 changes: 12 additions & 12 deletions src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down