mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-05 20:30:57 +00:00
Derive Eq, PartialEq for CompressedEdwardsY
This commit is contained in:
parent
7034a875bd
commit
eaa5d3e595
1 changed files with 1 additions and 13 deletions
14
src/curve.rs
14
src/curve.rs
|
|
@ -98,7 +98,7 @@ use util::CTAssignable;
|
||||||
///
|
///
|
||||||
/// The first 255 bits of a CompressedEdwardsY represent the
|
/// The first 255 bits of a CompressedEdwardsY represent the
|
||||||
/// y-coordinate. The high bit of the 32nd byte gives the sign of `x`.
|
/// 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]);
|
pub struct CompressedEdwardsY(pub [u8; 32]);
|
||||||
|
|
||||||
impl Debug for CompressedEdwardsY {
|
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<usize> for CompressedEdwardsY {
|
impl Index<usize> for CompressedEdwardsY {
|
||||||
type Output = u8;
|
type Output = u8;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue