pub trait Hash {
    type Input: Inject + Eject + Clone;
    type Output: Inject + Eject + Ternary<Output = Self::Output> + ToBits + Clone;

    // Required method
    fn hash(&self, input: &[Self::Input]) -> Self::Output;
}
Expand description

A trait for a hash function.

Required Associated Types§

source

type Input: Inject + Eject + Clone

source

type Output: Inject + Eject + Ternary<Output = Self::Output> + ToBits + Clone

Required Methods§

source

fn hash(&self, input: &[Self::Input]) -> Self::Output

Returns the hash of the given input.

Trait Implementations§

source§

impl<E: Environment, const NUM_BITS: u8> Metrics<dyn Hash<Output = Field<E>, Input = Boolean<E>>> for Pedersen<E, NUM_BITS>

§

type Case = Vec<Mode, Global>

source§

fn count(case: &Self::Case) -> Count

Returns the number of constants, public inputs, private inputs, and constraints.
source§

impl<E: Environment, const NUM_BITS: u8> OutputMode<dyn Hash<Output = Field<E>, Input = Boolean<E>>> for Pedersen<E, NUM_BITS>

§

type Case = Vec<Mode, Global>

source§

fn output_mode(parameter: &Self::Case) -> Mode

Returns the mode of the output.

Implementors§

source§

impl<E: Environment, const NUM_BITS: u8> Hash for Pedersen<E, NUM_BITS>

§

type Input = Boolean<E>

§

type Output = Field<E>

source§

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

§

type Input = Boolean<E>

§

type Output = Field<E>

source§

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

§

type Input = Field<E>

§

type Output = Field<E>