pub trait PathHash<E: Environment> {
    type Hash: Clone + Default + Inject<Primitive = <Self::Primitive as PathHash>::Hash> + Eject<Primitive = <Self::Primitive as PathHash>::Hash> + Equal<Output = Boolean<E>> + Ternary<Boolean = Boolean<E>, Output = Self::Hash>;
    type Primitive: PathHash;

    // Required method
    fn hash_children(&self, children: &[Self::Hash]) -> Self::Hash;

    // Provided method
    fn hash_empty<const ARITY: u8>(&self) -> Self::Hash { ... }
}
Expand description

A trait for a Merkle path hash function.

Required Associated Types§

source

type Hash: Clone + Default + Inject<Primitive = <Self::Primitive as PathHash>::Hash> + Eject<Primitive = <Self::Primitive as PathHash>::Hash> + Equal<Output = Boolean<E>> + Ternary<Boolean = Boolean<E>, Output = Self::Hash>

source

type Primitive: PathHash

Required Methods§

source

fn hash_children(&self, children: &[Self::Hash]) -> Self::Hash

Returns the hash of the given child nodes.

Provided Methods§

source

fn hash_empty<const ARITY: u8>(&self) -> Self::Hash

Returns the empty hash.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

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

source§

fn hash_children(&self, children: &[Self::Hash]) -> Self::Hash

Returns the hash of the given child nodes.

§

type Hash = Field<E>

§

type Primitive = BHP<<E as Environment>::Network, NUM_WINDOWS, WINDOW_SIZE>

source§

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

source§

fn hash_children(&self, children: &[Self::Hash]) -> Self::Hash

Returns the hash of the given child nodes.

§

type Hash = Field<E>

§

type Primitive = Poseidon<<E as Environment>::Network, RATE>

source§

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

source§

fn hash_children(&self, children: &[Self::Hash]) -> Self::Hash

Returns the hash of the given child nodes.

§

type Hash = BooleanHash<E, VARIANT>

§

type Primitive = Keccak<TYPE, VARIANT>

Implementors§