Merge branch 'release/1.0.3'

This commit is contained in:
Henry de Valence 2019-01-27 23:18:35 -08:00
commit 4bdccd7b7c
3 changed files with 14 additions and 4 deletions

View file

@ -1,6 +1,6 @@
[package]
name = "curve25519-dalek"
version = "1.0.2"
version = "1.0.3"
authors = ["Isis Lovecruft <isis@patternsinthevoid.net>",
"Henry de Valence <hdevalence@hdevalence.ca>"]
readme = "README.md"

View file

@ -142,6 +142,12 @@ use traits::VartimeMultiscalarMul;
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct CompressedEdwardsY(pub [u8; 32]);
impl ConstantTimeEq for CompressedEdwardsY {
fn ct_eq(&self, other: &CompressedEdwardsY) -> Choice {
self.as_bytes().ct_eq(other.as_bytes())
}
}
impl Debug for CompressedEdwardsY {
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
write!(f, "CompressedEdwardsY: {:?}", self.as_bytes())
@ -377,9 +383,7 @@ impl ConditionallySelectable for EdwardsPoint {
impl ConstantTimeEq for EdwardsPoint {
fn ct_eq(&self, other: &EdwardsPoint) -> Choice {
self.compress()
.as_bytes()
.ct_eq(other.compress().as_bytes())
self.compress().ct_eq(&other.compress())
}
}

View file

@ -202,6 +202,12 @@ use traits::{MultiscalarMul, VartimeMultiscalarMul};
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct CompressedRistretto(pub [u8; 32]);
impl ConstantTimeEq for CompressedRistretto {
fn ct_eq(&self, other: &CompressedRistretto) -> Choice {
self.as_bytes().ct_eq(other.as_bytes())
}
}
impl CompressedRistretto {
/// Copy the bytes of this `CompressedRistretto`.
pub fn to_bytes(&self) -> [u8; 32] {