Skip to content

Commit

Permalink
PublicKey to derive Hash
Browse files Browse the repository at this point in the history
  • Loading branch information
moshababo committed Nov 1, 2023
1 parent 96f1cba commit 40faa1f
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions node/libs/crypto/src/bn254/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use ark_ec::{
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
pub use error::Error;
use num_traits::Zero as _;
use std::{collections::HashMap, fmt::Debug, hash::Hasher};
use std::{collections::HashMap, fmt::Debug};

#[doc(hidden)]
pub mod error;
Expand Down Expand Up @@ -54,7 +54,7 @@ impl ByteFmt for SecretKey {
}

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

impl ByteFmt for PublicKey {
Expand All @@ -71,12 +71,6 @@ impl ByteFmt for PublicKey {
}
}

impl std::hash::Hash for PublicKey {
fn hash<H: Hasher>(&self, state: &mut H) {
self.0.hash(state);
}
}

impl PartialOrd for PublicKey {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.cmp(other))
Expand Down

0 comments on commit 40faa1f

Please sign in to comment.