pub struct InstanceVar<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> {
pub parameters: PoseidonParameters<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>,
pub cs: ConstraintSystemRef<Fq>,
pub state_words: Vec<FpVar<Fq>>,
}
Expand description
Represents a Poseidon permutation instance.
Fields§
§parameters: PoseidonParameters<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
Parameters for this instance of Poseidon.
cs: ConstraintSystemRef<Fq>
Constraint system
state_words: Vec<FpVar<Fq>>
Current state
Implementations§
Source§impl<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> InstanceVar<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
impl<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> InstanceVar<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
Sourcepub fn n_to_1_fixed_hash(
parameters: PoseidonParameters<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>,
cs: ConstraintSystemRef<Fq>,
input_words: [FpVar<Fq>; STATE_SIZE],
) -> FpVar<Fq>
pub fn n_to_1_fixed_hash( parameters: PoseidonParameters<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>, cs: ConstraintSystemRef<Fq>, input_words: [FpVar<Fq>; STATE_SIZE], ) -> FpVar<Fq>
Fixed width hash from n:1. Outputs a Fq given t
input words.
Auto Trait Implementations§
impl<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> Freeze for InstanceVar<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
impl<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> !RefUnwindSafe for InstanceVar<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
impl<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> !Send for InstanceVar<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
impl<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> !Sync for InstanceVar<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
impl<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> Unpin for InstanceVar<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
impl<const STATE_SIZE: usize, const STATE_SIZE_MINUS_1: usize, const NUM_MDS_ELEMENTS: usize, const NUM_STATE_SIZE_MINUS_1_ELEMENTS: usize, const NUM_ROUND_ROWS: usize, const NUM_ROUND_COLS: usize, const NUM_ROUND_ELEMENTS: usize, const NUM_PARTIAL_ROUNDS: usize> !UnwindSafe for InstanceVar<STATE_SIZE, STATE_SIZE_MINUS_1, NUM_MDS_ELEMENTS, NUM_STATE_SIZE_MINUS_1_ELEMENTS, NUM_ROUND_ROWS, NUM_ROUND_COLS, NUM_ROUND_ELEMENTS, NUM_PARTIAL_ROUNDS>
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
§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