mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-05 20:30:57 +00:00
Merge remote-tracking branch 'isis/develop' into develop
This commit is contained in:
commit
66cbf19fef
4 changed files with 14 additions and 17 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "curve25519-dalek"
|
name = "curve25519-dalek"
|
||||||
version = "0.7.1"
|
version = "0.8.0"
|
||||||
authors = ["Isis Lovecruft <isis@patternsinthevoid.net>",
|
authors = ["Isis Lovecruft <isis@patternsinthevoid.net>",
|
||||||
"Henry de Valence <hdevalence@hdevalence.ca>"]
|
"Henry de Valence <hdevalence@hdevalence.ca>"]
|
||||||
readme = "README.md"
|
readme = "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
|
To install, add the following to the dependencies section of your project's
|
||||||
`Cargo.toml`:
|
`Cargo.toml`:
|
||||||
|
|
||||||
curve25519-dalek = "^0.7"
|
curve25519-dalek = "^0.8"
|
||||||
|
|
||||||
Then, in your library or executable source, add:
|
Then, in your library or executable source, add:
|
||||||
|
|
||||||
|
|
|
||||||
14
src/curve.rs
14
src/curve.rs
|
|
@ -87,8 +87,6 @@ use core::ops::{Mul, MulAssign};
|
||||||
use core::ops::Index;
|
use core::ops::Index;
|
||||||
|
|
||||||
use constants;
|
use constants;
|
||||||
#[cfg(feature = "yolocrypto")]
|
|
||||||
use decaf::DecafPoint;
|
|
||||||
use field::FieldElement;
|
use field::FieldElement;
|
||||||
use scalar::Scalar;
|
use scalar::Scalar;
|
||||||
use subtle::arrays_equal_ct;
|
use subtle::arrays_equal_ct;
|
||||||
|
|
@ -897,16 +895,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
|
/// Precomputation
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
|
@ -1664,7 +1652,7 @@ mod bench {
|
||||||
use test::Bencher;
|
use test::Bencher;
|
||||||
use constants;
|
use constants;
|
||||||
use super::*;
|
use super::*;
|
||||||
use super::test::{A_SCALAR, A_TIMES_BASEPOINT, B_SCALAR};
|
use super::test::{A_SCALAR};
|
||||||
|
|
||||||
#[bench]
|
#[bench]
|
||||||
fn basepoint_mult(b: &mut Bencher) {
|
fn basepoint_mult(b: &mut Bencher) {
|
||||||
|
|
|
||||||
13
src/decaf.rs
13
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
|
/// Precomputation
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
pub struct DecafBasepointTable(pub EdwardsBasepointTable);
|
pub struct DecafBasepointTable(pub EdwardsBasepointTable);
|
||||||
|
|
@ -576,7 +586,6 @@ mod test {
|
||||||
use scalar::Scalar;
|
use scalar::Scalar;
|
||||||
use constants;
|
use constants;
|
||||||
use curve::CompressedEdwardsY;
|
use curve::CompressedEdwardsY;
|
||||||
use curve::ExtendedPoint;
|
|
||||||
use curve::Identity;
|
use curve::Identity;
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
|
@ -662,7 +671,7 @@ mod test {
|
||||||
// Check that P is on the curve
|
// Check that P is on the curve
|
||||||
assert!(P.0.is_valid());
|
assert!(P.0.is_valid());
|
||||||
// Check that P is in the image of the decaf map
|
// Check that P is in the image of the decaf map
|
||||||
let compressed_P = P.compress();
|
P.compress();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue