pub trait LeafHash {
    type Hash: Default + Inject + Eject + Ternary;
    type Leaf;

    // Required method
    fn hash_leaf(&self, leaf: &Self::Leaf) -> Self::Hash;
}
Expand description

A trait for a Merkle leaf hash function.

Required Associated Types§

Required Methods§

Source

fn hash_leaf(&self, leaf: &Self::Leaf) -> Self::Hash

Returns the hash of the given leaf node.

Implementations on Foreign Types§

Source§

impl<E: Environment, const NUM_WINDOWS: u8, const WINDOW_SIZE: u8> LeafHash for BHP<E, NUM_WINDOWS, WINDOW_SIZE>

Source§

fn hash_leaf(&self, leaf: &Self::Leaf) -> Self::Hash

Returns the hash of the given leaf node.

Source§

type Hash = Field<E>

Source§

type Leaf = Vec<Boolean<E>>

Source§

impl<E: Environment, const RATE: usize> LeafHash for Poseidon<E, RATE>

Source§

fn hash_leaf(&self, leaf: &Self::Leaf) -> Self::Hash

Returns the hash of the given leaf node.

Source§

type Hash = Field<E>

Source§

type Leaf = Vec<Field<E>>

Source§

impl<E: Environment, const TYPE: u8, const VARIANT: usize> LeafHash for Keccak<E, TYPE, VARIANT>

Source§

fn hash_leaf(&self, leaf: &Self::Leaf) -> Self::Hash

Returns the hash of the given leaf node.

Source§

type Hash = BooleanHash<E, VARIANT>

Source§

type Leaf = Vec<Boolean<E>>

Implementors§