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

    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.

Implementations on Foreign Types§

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.

§

type Input = bool

§

type Output = Field<E>

§

type Randomizer = Scalar<E>

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.

§

type Input = bool

§

type Output = Field<E>

§

type Randomizer = Scalar<E>

Implementors§