Skip to content

Commit

Permalink
also impl Hash for Nullifier
Browse files Browse the repository at this point in the history
  • Loading branch information
bazzilic committed Aug 24, 2023
1 parent fc8c320 commit 828d30f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions taiga_halo2/src/nullifier.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use std::hash::Hash;

use crate::constant::GENERATOR;
use crate::{
note::NoteCommitment,
Expand Down Expand Up @@ -87,6 +89,12 @@ impl BorshDeserialize for Nullifier {
}
}

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

impl NullifierKeyContainer {
pub fn random_key<R: RngCore>(mut rng: R) -> Self {
NullifierKeyContainer::Key(pallas::Base::random(&mut rng))
Expand Down

0 comments on commit 828d30f

Please sign in to comment.