snarkvm_circuit_algorithms::traits

Trait Commit

Source
pub trait Commit {
    type Input;
    type Output;
    type Randomizer;

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

A trait for a commitment scheme.

Required Associated Types§

Required Methods§

Source

fn commit( &self, input: &[Self::Input], randomizer: &Self::Randomizer, ) -> Self::Output

Returns the commitment to the given input and randomizer.

Trait Implementations§

Source§

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

Source§

type Case = (Vec<Mode>, 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 Commit<Randomizer = Scalar<E>, Input = Boolean<E>, Output = Field<E>>> for Pedersen<E, NUM_BITS>

Source§

type Case = (Vec<Mode>, Vec<Mode>)

Source§

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

Returns the mode of the output.

Implementors§

Source§

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

Source§

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