Trait halo2_gadgets::sinsemilla::merkle::MerkleInstructions
source · pub trait MerkleInstructions<C: CurveAffine, const PATH_LENGTH: usize, const K: usize, const MAX_WORDS: usize>: SinsemillaInstructions<C, K, MAX_WORDS> + CondSwapInstructions<C::Base> + UtilitiesInstructions<C::Base> + Chip<C::Base> {
// Required method
fn hash_layer(
&self,
layouter: impl Layouter<C::Base>,
Q: C,
l: usize,
left: Self::Var,
right: Self::Var
) -> Result<Self::Var, Error>;
}
Expand description
Instructions to check the validity of a Merkle path of a given PATH_LENGTH
.
The hash function used is a Sinsemilla instance with K
-bit words.
The hash function can process MAX_WORDS
words.
Required Methods§
sourcefn hash_layer(
&self,
layouter: impl Layouter<C::Base>,
Q: C,
l: usize,
left: Self::Var,
right: Self::Var
) -> Result<Self::Var, Error>
fn hash_layer( &self, layouter: impl Layouter<C::Base>, Q: C, l: usize, left: Self::Var, right: Self::Var ) -> Result<Self::Var, Error>
Compute MerkleCRH for a given layer
. The hash that computes the root
is at layer 0, and the hashes that are applied to two leaves are at
layer MERKLE_DEPTH - 1
= layer 31.