diff --git a/taiga_halo2/src/note.rs b/taiga_halo2/src/note.rs index 94a6225f..ffcae5ea 100644 --- a/taiga_halo2/src/note.rs +++ b/taiga_halo2/src/note.rs @@ -23,7 +23,10 @@ use pasta_curves::{ pallas, }; use rand::{Rng, RngCore}; -use std::io; +use std::{ + hash::{Hash, Hasher}, + io, +}; /// A commitment to a note. #[derive(Copy, Debug, Clone)] @@ -406,6 +409,13 @@ impl ValueBase { } } +impl Hash for ValueBase { + fn hash(&self, state: &mut H) { + self.app_vk.to_repr().as_ref().hash(state); + self.app_data_static.to_repr().as_ref().hash(state); + } +} + impl RandomSeed { pub fn random(mut rng: R) -> Self { let mut rseed = [0; 32];