Struct snarkvm_circuit::pedersen::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
sourceimpl<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,
sourcefn 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>
sourceimpl<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,
sourcefn 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>
sourceimpl<E, const NUM_BITS: u8> Hash for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> Hash for Pedersen<E, NUM_BITS>where
E: Environment,
sourceimpl<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,
sourcefn 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>
sourceimpl<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,
sourceimpl<E, const NUM_BITS: u8> Metrics<dyn Commit<Input = Boolean<E>, Output = Field<E>, Randomizer = Scalar<E>> + 'static> for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> Metrics<dyn Commit<Input = Boolean<E>, Output = Field<E>, Randomizer = Scalar<E>> + 'static> for Pedersen<E, NUM_BITS>where
E: Environment,
sourceimpl<E, const NUM_BITS: u8> Metrics<dyn CommitUncompressed<Input = Boolean<E>, Output = Group<E>, Randomizer = Scalar<E>> + 'static> for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> Metrics<dyn CommitUncompressed<Input = Boolean<E>, Output = Group<E>, Randomizer = Scalar<E>> + 'static> for Pedersen<E, NUM_BITS>where
E: Environment,
sourceimpl<E, const NUM_BITS: u8> Metrics<dyn Hash<Input = Boolean<E>, Output = Field<E>> + 'static> for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> Metrics<dyn Hash<Input = Boolean<E>, Output = Field<E>> + 'static> for Pedersen<E, NUM_BITS>where
E: Environment,
sourceimpl<E, const NUM_BITS: u8> Metrics<dyn HashUncompressed<Input = Boolean<E>, Output = Group<E>> + 'static> for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> Metrics<dyn HashUncompressed<Input = Boolean<E>, Output = Group<E>> + 'static> for Pedersen<E, NUM_BITS>where
E: Environment,
sourceimpl<E, const NUM_BITS: u8> OutputMode<dyn Commit<Input = Boolean<E>, Output = Field<E>, Randomizer = Scalar<E>> + 'static> for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> OutputMode<dyn Commit<Input = Boolean<E>, Output = Field<E>, Randomizer = Scalar<E>> + 'static> for Pedersen<E, NUM_BITS>where
E: Environment,
sourceimpl<E, const NUM_BITS: u8> OutputMode<dyn CommitUncompressed<Input = Boolean<E>, Output = Group<E>, Randomizer = Scalar<E>> + 'static> for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> OutputMode<dyn CommitUncompressed<Input = Boolean<E>, Output = Group<E>, Randomizer = Scalar<E>> + 'static> for Pedersen<E, NUM_BITS>where
E: Environment,
sourceimpl<E, const NUM_BITS: u8> OutputMode<dyn Hash<Input = Boolean<E>, Output = Field<E>> + 'static> for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> OutputMode<dyn Hash<Input = Boolean<E>, Output = Field<E>> + 'static> for Pedersen<E, NUM_BITS>where
E: Environment,
sourceimpl<E, const NUM_BITS: u8> OutputMode<dyn HashUncompressed<Input = Boolean<E>, Output = Group<E>> + 'static> for Pedersen<E, NUM_BITS>where
E: Environment,
impl<E, const NUM_BITS: u8> OutputMode<dyn HashUncompressed<Input = Boolean<E>, Output = Group<E>> + 'static> for Pedersen<E, NUM_BITS>where
E: Environment,
type Case = Vec<Mode, Global>
sourcefn output_mode(
parameter: &<Pedersen<E, NUM_BITS> as OutputMode<dyn HashUncompressed<Input = Boolean<E>, Output = Group<E>> + 'static>>::Case
) -> Mode
fn output_mode(
parameter: &<Pedersen<E, NUM_BITS> as OutputMode<dyn HashUncompressed<Input = Boolean<E>, Output = Group<E>> + 'static>>::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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more