From 40faa1f061bb76b2305b477e448d538ab48efc80 Mon Sep 17 00:00:00 2001 From: Moshe Shababo <17073733+moshababo@users.noreply.github.com> Date: Wed, 1 Nov 2023 16:01:03 -0500 Subject: [PATCH] PublicKey to derive Hash --- node/libs/crypto/src/bn254/mod.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/node/libs/crypto/src/bn254/mod.rs b/node/libs/crypto/src/bn254/mod.rs index 0c24ac7a..daa16e66 100644 --- a/node/libs/crypto/src/bn254/mod.rs +++ b/node/libs/crypto/src/bn254/mod.rs @@ -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; @@ -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 { @@ -71,12 +71,6 @@ impl ByteFmt for PublicKey { } } -impl std::hash::Hash for PublicKey { - fn hash(&self, state: &mut H) { - self.0.hash(state); - } -} - impl PartialOrd for PublicKey { fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other))