pub trait PathHash: Clone + Send + Sync {
    type Hash: FieldTrait;

    // Required method
    fn hash_children(
        &self,
        left: &Self::Hash,
        right: &Self::Hash
    ) -> Result<Self::Hash>;

    // Provided methods
    fn hash_empty(&self) -> Result<Self::Hash> { ... }
    fn hash_all_children(
        &self,
        child_nodes: &[(Self::Hash, Self::Hash)]
    ) -> Result<Vec<Self::Hash>> { ... }
}
Expand description

A trait for a Merkle path hash function.

Required Associated Types§

Required Methods§

source

fn hash_children( &self, left: &Self::Hash, right: &Self::Hash ) -> Result<Self::Hash>

Returns the hash of the given child nodes.

Provided Methods§

source

fn hash_empty(&self) -> Result<Self::Hash>

Returns the empty hash.

source

fn hash_all_children( &self, child_nodes: &[(Self::Hash, Self::Hash)] ) -> Result<Vec<Self::Hash>>

Returns the hash for each tuple of child nodes.

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 for BHP<E, NUM_WINDOWS, WINDOW_SIZE>

source§

fn hash_children( &self, left: &Self::Hash, right: &Self::Hash ) -> Result<Self::Hash>

Returns the hash of the given child nodes.

§

type Hash = Field<E>

source§

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

source§

fn hash_children( &self, left: &Self::Hash, right: &Self::Hash ) -> Result<Self::Hash>

Returns the hash of the given child nodes.

§

type Hash = Field<E>

Implementors§