diff --git a/src/curve.rs b/src/curve.rs index b0732ae..b36cc0b 100644 --- a/src/curve.rs +++ b/src/curve.rs @@ -98,7 +98,7 @@ use util::CTAssignable; /// /// The first 255 bits of a CompressedEdwardsY represent the /// y-coordinate. The high bit of the 32nd byte gives the sign of `x`. -#[derive(Copy, Clone)] +#[derive(Copy, Clone, Eq, PartialEq)] pub struct CompressedEdwardsY(pub [u8; 32]); impl Debug for CompressedEdwardsY { @@ -107,18 +107,6 @@ impl Debug for CompressedEdwardsY { } } -impl Eq for CompressedEdwardsY {} -impl PartialEq for CompressedEdwardsY { - /// Determine if this `CompressedEdwardsY` is equal to another. - /// - /// # Warning - /// - /// This function is NOT constant time. - fn eq(&self, other: &CompressedEdwardsY) -> bool { - return self.0 == other.0; - } -} - impl Index for CompressedEdwardsY { type Output = u8;