Skip to main content

Commit

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

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

A trait for a commitment scheme.

Required Associated Types§

Required Methods§

Source

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

Returns the commitment to the given input and randomizer.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

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

Source§

fn commit( &self, input: &[<Pedersen<E, NUM_BITS> as Commit>::Input], randomizer: &<Pedersen<E, NUM_BITS> as Commit>::Randomizer, ) -> Result<<Pedersen<E, NUM_BITS> as Commit>::Output, Error>

Returns the Pedersen commitment of the given input and randomizer as a field element.

Source§

type Input = bool

Source§

type Output = Field<E>

Source§

type Randomizer = Scalar<E>

Source§

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

Source§

fn commit( &self, input: &[<BHP<E, NUM_WINDOWS, WINDOW_SIZE> as Commit>::Input], randomizer: &<BHP<E, NUM_WINDOWS, WINDOW_SIZE> as Commit>::Randomizer, ) -> Result<<BHP<E, NUM_WINDOWS, WINDOW_SIZE> as Commit>::Output, Error>

Returns the BHP commitment of the given input and randomizer as a field element.

Source§

type Input = bool

Source§

type Output = Field<E>

Source§

type Randomizer = Scalar<E>

Implementors§