Struct snarkvm_circuit::Pedersen
source · 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.
Trait Implementations§
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
) -> <Pedersen<E, NUM_BITS> as Commit>::Output
fn commit( &self, input: &[<Pedersen<E, NUM_BITS> as Commit>::Input], randomizer: &<Pedersen<E, NUM_BITS> as Commit>::Randomizer ) -> <Pedersen<E, NUM_BITS> as Commit>::Output
Returns the Pedersen commitment of the given input and randomizer as a field element.
type Input = Boolean<E>
type Output = Field<E>
type Randomizer = Scalar<E>
source§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,
source§fn commit_uncompressed(
&self,
input: &[<Pedersen<E, NUM_BITS> as CommitUncompressed>::Input],
randomizer: &<Pedersen<E, NUM_BITS> as CommitUncompressed>::Randomizer
) -> <Pedersen<E, NUM_BITS> as CommitUncompressed>::Output
fn commit_uncompressed( &self, input: &[<Pedersen<E, NUM_BITS> as CommitUncompressed>::Input], randomizer: &<Pedersen<E, NUM_BITS> as CommitUncompressed>::Randomizer ) -> <Pedersen<E, NUM_BITS> as CommitUncompressed>::Output
Returns the Pedersen commitment of the given input and randomizer as an affine group element.
type Input = Boolean<E>
type Output = Group<E>
type Randomizer = Scalar<E>
source§impl<E, const NUM_BITS: u8> HashUncompressed for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> HashUncompressed for Pedersen<E, NUM_BITS>where E: Environment,
source§fn hash_uncompressed(
&self,
input: &[<Pedersen<E, NUM_BITS> as HashUncompressed>::Input]
) -> <Pedersen<E, NUM_BITS> as HashUncompressed>::Output
fn hash_uncompressed( &self, input: &[<Pedersen<E, NUM_BITS> as HashUncompressed>::Input] ) -> <Pedersen<E, NUM_BITS> as HashUncompressed>::Output
Returns the Pedersen hash of the given input as an affine group element.
type Input = Boolean<E>
type Output = Group<E>
source§impl<E, const NUM_BITS: u8> Inject for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> Inject for Pedersen<E, NUM_BITS>where E: Environment,
source§impl<E, const NUM_BITS: u8> Metrics<dyn Commit<Output = Field<E>, Randomizer = Scalar<E>, Input = Boolean<E>>> for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> Metrics<dyn Commit<Output = Field<E>, Randomizer = Scalar<E>, Input = Boolean<E>>> for Pedersen<E, NUM_BITS>where E: Environment,
source§impl<E, const NUM_BITS: u8> Metrics<dyn CommitUncompressed<Randomizer = Scalar<E>, Output = Group<E>, Input = Boolean<E>>> for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> Metrics<dyn CommitUncompressed<Randomizer = Scalar<E>, Output = Group<E>, Input = Boolean<E>>> for Pedersen<E, NUM_BITS>where E: Environment,
source§impl<E, const NUM_BITS: u8> Metrics<dyn Hash<Output = Field<E>, Input = Boolean<E>>> for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> Metrics<dyn Hash<Output = Field<E>, Input = Boolean<E>>> for Pedersen<E, NUM_BITS>where E: Environment,
source§impl<E, const NUM_BITS: u8> Metrics<dyn HashUncompressed<Input = Boolean<E>, Output = Group<E>>> for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> Metrics<dyn HashUncompressed<Input = Boolean<E>, Output = Group<E>>> for Pedersen<E, NUM_BITS>where E: Environment,
source§impl<E, const NUM_BITS: u8> OutputMode<dyn Commit<Output = Field<E>, Randomizer = Scalar<E>, Input = Boolean<E>>> for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> OutputMode<dyn Commit<Output = Field<E>, Randomizer = Scalar<E>, Input = Boolean<E>>> for Pedersen<E, NUM_BITS>where E: Environment,
source§impl<E, const NUM_BITS: u8> OutputMode<dyn CommitUncompressed<Randomizer = Scalar<E>, Output = Group<E>, Input = Boolean<E>>> for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> OutputMode<dyn CommitUncompressed<Randomizer = Scalar<E>, Output = Group<E>, Input = Boolean<E>>> for Pedersen<E, NUM_BITS>where E: Environment,
source§impl<E, const NUM_BITS: u8> OutputMode<dyn Hash<Output = Field<E>, Input = Boolean<E>>> for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> OutputMode<dyn Hash<Output = Field<E>, Input = Boolean<E>>> for Pedersen<E, NUM_BITS>where E: Environment,
source§impl<E, const NUM_BITS: u8> OutputMode<dyn HashUncompressed<Input = Boolean<E>, Output = Group<E>>> for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> OutputMode<dyn HashUncompressed<Input = Boolean<E>, Output = Group<E>>> for Pedersen<E, NUM_BITS>where E: Environment,
type Case = Vec<Mode, Global>
source§fn output_mode(
parameter: &<Pedersen<E, NUM_BITS> as OutputMode<dyn HashUncompressed<Input = Boolean<E>, Output = Group<E>>>>::Case
) -> Mode
fn output_mode( parameter: &<Pedersen<E, NUM_BITS> as OutputMode<dyn HashUncompressed<Input = Boolean<E>, Output = Group<E>>>>::Case ) -> Mode
Returns the mode of the output.
Auto Trait Implementations§
impl<E, const NUM_BITS: u8> RefUnwindSafe for Pedersen<E, NUM_BITS>where <E as Environment>::BaseField: UnwindSafe + RefUnwindSafe,
impl<E, const NUM_BITS: u8> !Send for Pedersen<E, NUM_BITS>
impl<E, const NUM_BITS: u8> !Sync for Pedersen<E, NUM_BITS>
impl<E, const NUM_BITS: u8> Unpin for Pedersen<E, NUM_BITS>where <E as Environment>::BaseField: Unpin,
impl<E, const NUM_BITS: u8> UnwindSafe for Pedersen<E, NUM_BITS>where <E as Environment>::BaseField: UnwindSafe + RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more