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§
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 Methods§
sourcefn hash_children(&self, children: &[Self::Hash]) -> Self::Hash
fn hash_children(&self, children: &[Self::Hash]) -> Self::Hash
Returns the hash of the given child nodes.
Provided Methods§
sourcefn hash_empty<const ARITY: u8>(&self) -> Self::Hash
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>
impl<E: Environment, const NUM_WINDOWS: u8, const WINDOW_SIZE: u8> PathHash<E> for BHP<E, NUM_WINDOWS, WINDOW_SIZE>
source§impl<E: Environment, const TYPE: u8, const VARIANT: usize> PathHash<E> for Keccak<E, TYPE, VARIANT>
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
fn hash_children(&self, children: &[Self::Hash]) -> Self::Hash
Returns the hash of the given child nodes.