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§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<Input = Boolean<E>, Output = Field<E>, Randomizer = Scalar<E>>> 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>>> for Pedersen<E, NUM_BITS>where
E: Environment,
Source§impl<E, const NUM_BITS: u8> Metrics<dyn CommitUncompressed<Input = Boolean<E>, Output = Group<E>, Randomizer = Scalar<E>>> 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>>> 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<Input = Boolean<E>, Output = Field<E>, Randomizer = Scalar<E>>> 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>>> for Pedersen<E, NUM_BITS>where
E: Environment,
Source§impl<E, const NUM_BITS: u8> OutputMode<dyn CommitUncompressed<Input = Boolean<E>, Output = Group<E>, Randomizer = Scalar<E>>> 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>>> 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>
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> Freeze for Pedersen<E, NUM_BITS>
impl<E, const NUM_BITS: u8> RefUnwindSafe for Pedersen<E, NUM_BITS>
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>
impl<E, const NUM_BITS: u8> UnwindSafe for Pedersen<E, NUM_BITS>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more