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§
Implementations on Foreign Types§
Source§impl<E, const NUM_BITS: u8> Commit for Pedersen<E, NUM_BITS>where
E: Environment,
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>
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>
Source§impl<E, const NUM_WINDOWS: u8, const WINDOW_SIZE: u8> Commit for BHP<E, NUM_WINDOWS, WINDOW_SIZE>where
E: Environment,
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>
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.