snarkvm_circuit_algorithms::traits

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: Environment, const NUM_BITS: u8> Metrics<dyn Hash<Output = Field<E>, Input = Boolean<E>>> for Pedersen<E, NUM_BITS>

Source§

type Case = Vec<Mode>

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>

Source§

type Case = Vec<Mode>

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>

Source§

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

Source§

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

Source§

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