Trait PathHash

Source
pub trait PathHash<E>
where 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

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

Source§

type Hash = Field<E>

Source§

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

Source§

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

Source§

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

Source§

type Hash = BooleanHash<E, VARIANT>

Source§

type Primitive = Keccak<TYPE, VARIANT>