Trait Hash

Source
pub trait Hash {
    type Input: Inject + Eject + Clone;
    type Output: Inject + Eject + ToBits + Clone;

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

A trait for a hash function.

Required Associated Types§

Required Methods§

Source

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

Returns the hash of the given input.

Trait Implementations§

Source§

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

Source§

type Case = Vec<Mode>

Source§

fn count( case: &<Pedersen<E, NUM_BITS> as Metrics<dyn Hash<Output = Field<E>, Input = Boolean<E>>>>::Case, ) -> Count

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

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

Source§

type Case = Vec<Mode>

Source§

fn output_mode( parameter: &<Pedersen<E, NUM_BITS> as OutputMode<dyn Hash<Output = Field<E>, Input = Boolean<E>>>>::Case, ) -> Mode

Returns the mode of the output.

Implementors§

Source§

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

Source§

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

Source§

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

Source§

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