From 0b70ab36382b52a24aeb1d4161d06e894af9b278 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Thu, 18 May 2017 02:57:10 +0000 Subject: [PATCH 1/6] Move `DecafPoint * Scalar` definition to decaf module. --- src/curve.rs | 10 ---------- src/decaf.rs | 10 ++++++++++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/curve.rs b/src/curve.rs index 870d82d..ce09627 100644 --- a/src/curve.rs +++ b/src/curve.rs @@ -897,16 +897,6 @@ impl<'a, 'b> Mul<&'b ExtendedPoint> for &'a Scalar { } } -#[cfg(feature = "yolocrypto")] -impl<'a, 'b> Mul<&'b DecafPoint> for &'a Scalar { - type Output = DecafPoint; - - /// Scalar multiplication: compute `self * scalar`. - fn mul(self, point: &'b DecafPoint) -> DecafPoint { - DecafPoint(self * &point.0) - } -} - /// Precomputation #[derive(Clone)] diff --git a/src/decaf.rs b/src/decaf.rs index 07c24c6..1b9cccb 100644 --- a/src/decaf.rs +++ b/src/decaf.rs @@ -458,6 +458,16 @@ impl<'a, 'b> Mul<&'b Scalar> for &'a DecafPoint { } } +impl<'a, 'b> Mul<&'b DecafPoint> for &'a Scalar { + type Output = DecafPoint; + + /// Scalar multiplication: compute `self * scalar`. + fn mul(self, point: &'b DecafPoint) -> DecafPoint { + DecafPoint(self * &point.0) + } +} + + /// Precomputation #[derive(Clone)] pub struct DecafBasepointTable(pub EdwardsBasepointTable); From 891cf76aab5f315cc206ff153916d6f3a4526df0 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Thu, 18 May 2017 03:42:31 +0000 Subject: [PATCH 2/6] Remove unused imports in curve::bench module. --- src/curve.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/curve.rs b/src/curve.rs index ce09627..3575af7 100644 --- a/src/curve.rs +++ b/src/curve.rs @@ -1654,7 +1654,7 @@ mod bench { use test::Bencher; use constants; use super::*; - use super::test::{A_SCALAR, A_TIMES_BASEPOINT, B_SCALAR}; + use super::test::{A_SCALAR}; #[bench] fn basepoint_mult(b: &mut Bencher) { From 767c99adf5b2e878963b1ecac9bdde7683f1e67e Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Thu, 18 May 2017 03:43:15 +0000 Subject: [PATCH 3/6] Remove unused assignment in a decaf test. --- src/decaf.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/decaf.rs b/src/decaf.rs index 1b9cccb..414f921 100644 --- a/src/decaf.rs +++ b/src/decaf.rs @@ -672,7 +672,7 @@ mod test { // Check that P is on the curve assert!(P.0.is_valid()); // Check that P is in the image of the decaf map - let compressed_P = P.compress(); + P.compress(); } } } From cc86091224220a5426b79b5c7a2c69f8e0916fcd Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Thu, 18 May 2017 03:43:42 +0000 Subject: [PATCH 4/6] Remove unused import of DecafPoint in curve module. --- src/curve.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/curve.rs b/src/curve.rs index 3575af7..a9387a6 100644 --- a/src/curve.rs +++ b/src/curve.rs @@ -87,8 +87,6 @@ use core::ops::{Mul, MulAssign}; use core::ops::Index; use constants; -#[cfg(feature = "yolocrypto")] -use decaf::DecafPoint; use field::FieldElement; use scalar::Scalar; use subtle::arrays_equal_ct; From b97868beb80170e734563d2ba8a546acfa40c90d Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Thu, 18 May 2017 03:44:42 +0000 Subject: [PATCH 5/6] Remove unused import of ExtendedPoint in decaf::test module. --- src/decaf.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/decaf.rs b/src/decaf.rs index 414f921..a97347f 100644 --- a/src/decaf.rs +++ b/src/decaf.rs @@ -586,7 +586,6 @@ mod test { use scalar::Scalar; use constants; use curve::CompressedEdwardsY; - use curve::ExtendedPoint; use curve::Identity; use super::*; From 562318d4b89c8195a7deb6aa28834421c3856883 Mon Sep 17 00:00:00 2001 From: Isis Lovecruft Date: Thu, 18 May 2017 06:25:58 +0000 Subject: [PATCH 6/6] Bump curve25519-dalek version to 0.8.0. --- Cargo.toml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5bdd3bc..f2f6534 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "curve25519-dalek" -version = "0.7.1" +version = "0.8.0" authors = ["Isis Lovecruft ", "Henry de Valence "] readme = "README.md" diff --git a/README.md b/README.md index ecd519f..7258558 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Extensive documentation is available [here](https://docs.rs/curve25519-dalek). To install, add the following to the dependencies section of your project's `Cargo.toml`: - curve25519-dalek = "^0.7" + curve25519-dalek = "^0.8" Then, in your library or executable source, add: