Skip to content

Commit

Permalink
Merge pull request #318 from Fiono11/new_branch
Browse files Browse the repository at this point in the history
Derive of Hash trait to CompressedRistretto, CompressedEdwardsY, MontgomeryPoint, and Scalar
  • Loading branch information
hdevalence authored Mar 2, 2020
2 parents 6a44f31 + 6a8e466 commit 59b1a42
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/edwards.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ use backend::vector::scalar_mul;
///
/// 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, Eq, PartialEq)]
#[derive(Copy, Clone, Eq, PartialEq, Hash)]
pub struct CompressedEdwardsY(pub [u8; 32]);

impl ConstantTimeEq for CompressedEdwardsY {
Expand Down
2 changes: 1 addition & 1 deletion src/montgomery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ use zeroize::Zeroize;

/// Holds the \\(u\\)-coordinate of a point on the Montgomery form of
/// Curve25519 or its twist.
#[derive(Copy, Clone, Debug)]
#[derive(Copy, Clone, Debug, Hash)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct MontgomeryPoint(pub [u8; 32]);

Expand Down
2 changes: 1 addition & 1 deletion src/ristretto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ use backend::vector::scalar_mul;
///
/// The Ristretto encoding is canonical, so two points are equal if and
/// only if their encodings are equal.
#[derive(Copy, Clone, Eq, PartialEq)]
#[derive(Copy, Clone, Eq, PartialEq, Hash)]
pub struct CompressedRistretto(pub [u8; 32]);

impl ConstantTimeEq for CompressedRistretto {
Expand Down
2 changes: 1 addition & 1 deletion src/scalar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ type UnpackedScalar = backend::serial::u32::scalar::Scalar29;

/// The `Scalar` struct holds an integer \\(s < 2\^{255} \\) which
/// represents an element of \\(\mathbb Z / \ell\\).
#[derive(Copy, Clone)]
#[derive(Copy, Clone, Hash)]
pub struct Scalar {
/// `bytes` is a little-endian byte encoding of an integer representing a scalar modulo the
/// group order.
Expand Down

0 comments on commit 59b1a42

Please sign in to comment.