Trait snarkvm_circuit::Hash

source ·
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§

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,

§

type Case = Vec<Mode, Global>

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,

§

type Case = Vec<Mode, Global>

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,

§

type Input = Boolean<E>

§

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,

§

type Input = Boolean<E>

§

type Output = Field<E>

source§

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

§

type Input = Field<E>

§

type Output = Field<E>