mirror of
https://github.com/saymrwulf/risc0-curve25519-dalek-source.git
synced 2026-09-04 20:03:40 +00:00
Merge branch 'master' into develop
This commit is contained in:
commit
ff0dc4a3db
3 changed files with 14 additions and 4 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -153,6 +153,12 @@ use backend::vector::scalar_mul;
|
|||
#[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())
|
||||
|
|
@ -388,9 +394,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())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -200,6 +200,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] {
|
||||
|
|
|
|||
Loading…
Reference in a new issue