pub trait Hash {
    type Input;
    type Output;

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

A trait for a hash function.

Required Associated Types§

Required Methods§

source

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

Returns the hash of the given input.

Implementations on Foreign Types§

source§

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

source§

fn hash( &self, input: &[<Pedersen<E, NUM_BITS> as Hash>::Input] ) -> Result<<Pedersen<E, NUM_BITS> as Hash>::Output, Error>

Returns the Pedersen hash of the given input as a field element.

§

type Input = bool

§

type Output = Field<E>

source§

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

source§

fn hash( &self, input: &[<BHP<E, NUM_WINDOWS, WINDOW_SIZE> as Hash>::Input] ) -> Result<<BHP<E, NUM_WINDOWS, WINDOW_SIZE> as Hash>::Output, Error>

Returns the BHP hash of the given input as a field element.

§

type Input = bool

§

type Output = Field<E>

source§

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

source§

fn hash( &self, input: &[<Poseidon<E, RATE> as Hash>::Input] ) -> Result<<Poseidon<E, RATE> as Hash>::Output, Error>

Returns the cryptographic hash for a list of field elements as input.

§

type Input = Field<E>

§

type Output = Field<E>

source§

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

source§

fn hash( &self, input: &[<Keccak<TYPE, VARIANT> as Hash>::Input] ) -> Result<<Keccak<TYPE, VARIANT> as Hash>::Output, Error>

Returns the Keccak hash of the given input as bits.

§

type Input = bool

§

type Output = Vec<bool>

Implementors§