Skip to content

Commit

Permalink
impl PartialEq for SecretKey
Browse files Browse the repository at this point in the history
  • Loading branch information
moshababo committed Nov 10, 2023
1 parent d0eeea4 commit e3074cb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion node/libs/crypto/src/bn254/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ pub mod hash;
mod testonly;

/// Type safety wrapper around a scalar value.
#[derive(PartialEq)]
pub struct SecretKey(Fr);

impl SecretKey {
Expand Down Expand Up @@ -67,6 +66,12 @@ impl Debug for SecretKey {
}
}

impl PartialEq for SecretKey {
fn eq(&self, other: &Self) -> bool {
self.public() == other.public()
}
}

/// Type safety wrapper around G2.
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct PublicKey(G2);
Expand Down

0 comments on commit e3074cb

Please sign in to comment.