pub struct Permutation { /* private fields */ }
Expand description
A Grøstl 512-bit state permutation.
The Grøstl hash function involves two permutations, P and Q, which are closely related. This gadget verifies one permutation, depending on the variant given as a constructor argument.
The state is represented as an array of 64 B8 elements, which is isomorphic to the standard representation of bytes in a Grøstl state. This isomorphic representation is cheaper to verify with a Binius M3 constrant system.
Implementations§
Source§impl Permutation
impl Permutation
pub fn new( table: &mut TableBuilder<'_>, pq: PermutationVariant, state_in: [Col<B8, 8>; 8], ) -> Self
pub fn populate<P>(&self, index: &mut TableWitnessSegment<'_, P>) -> Result<()>where
P: PackedFieldIndexable<Scalar = B128> + PackedExtension<B1> + PackedExtension<B8>,
PackedSubfield<P, B8>: PackedTransformationFactory<PackedSubfield<P, B8>>,
Sourcepub fn populate_state_in<'a, P>(
&self,
index: &mut TableWitnessSegment<'_, P>,
states: impl IntoIterator<Item = &'a [B8; 64]>,
) -> Result<()>
pub fn populate_state_in<'a, P>( &self, index: &mut TableWitnessSegment<'_, P>, states: impl IntoIterator<Item = &'a [B8; 64]>, ) -> Result<()>
Populate the input column of the witness with a full permutation state.
Sourcepub fn read_state_outs<'a, P>(
&'a self,
index: &'a mut TableWitnessSegment<'a, P>,
) -> Result<impl Iterator<Item = [B8; 64]> + 'a>
pub fn read_state_outs<'a, P>( &'a self, index: &'a mut TableWitnessSegment<'a, P>, ) -> Result<impl Iterator<Item = [B8; 64]> + 'a>
Reads the state outputs from the witness index.
This is currently only used for testing.
Trait Implementations§
Source§impl Clone for Permutation
impl Clone for Permutation
Source§fn clone(&self) -> Permutation
fn clone(&self) -> Permutation
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for Permutation
impl RefUnwindSafe for Permutation
impl Send for Permutation
impl Sync for Permutation
impl Unpin for Permutation
impl UnwindSafe for Permutation
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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