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§

source

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.

Implementors§

source§

impl<Hash, Commit, F, const MERKLE_DEPTH: usize> MerkleInstructions<EpAffine, MERKLE_DEPTH, { sinsemilla::K }, { sinsemilla::C }> for MerkleChip<Hash, Commit, F>where Hash: HashDomains<Affine> + Eq, F: FixedPoints<Affine>, Commit: CommitDomains<Affine, F, Hash> + Eq,