Struct snarkvm_wasm::algorithms::Pedersen
pub struct Pedersen<E, const NUM_BITS: u8>where
E: Environment,{ /* private fields */ }Expand description
Pedersen is a collision-resistant hash function that takes a variable-length input. The Pedersen hash function does not behave like a random oracle, see Poseidon for one.
Implementations§
§impl<E, const NUM_BITS: u8> Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> Pedersen<E, NUM_BITS>where
E: Environment,
Trait Implementations§
§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,
§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>
§impl<E, const NUM_BITS: u8> CommitUncompressed for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> CommitUncompressed for Pedersen<E, NUM_BITS>where
E: Environment,
§fn commit_uncompressed(
&self,
input: &[<Pedersen<E, NUM_BITS> as CommitUncompressed>::Input],
randomizer: &<Pedersen<E, NUM_BITS> as CommitUncompressed>::Randomizer
) -> Result<<Pedersen<E, NUM_BITS> as CommitUncompressed>::Output, Error>
fn commit_uncompressed(
&self,
input: &[<Pedersen<E, NUM_BITS> as CommitUncompressed>::Input],
randomizer: &<Pedersen<E, NUM_BITS> as CommitUncompressed>::Randomizer
) -> Result<<Pedersen<E, NUM_BITS> as CommitUncompressed>::Output, Error>
Returns the Pedersen commitment of the given input and randomizer as a group element.