pub struct GenericPoseidon2LinearLayersMonty31<FP, ILBP> { /* private fields */ }
Expand description
An implementation of the the matrix multiplications in the internal and external layers of Poseidon2.
This can act on [AF; WIDTH]
for any AbstractField which implements multiplication by Monty<31>
field elements.
This will usually be slower than the Poseidon2 permutation built from Poseidon2InternalLayerMonty31
and
Poseidon2ExternalLayerMonty31
but it does work in more cases.
Trait Implementations§
Source§impl<FP, AF, ILBP, const WIDTH: usize> GenericPoseidon2LinearLayers<AF, WIDTH> for GenericPoseidon2LinearLayersMonty31<FP, ILBP>where
FP: FieldParameters,
AF: AbstractField + Mul<MontyField31<FP>, Output = AF>,
ILBP: InternalLayerBaseParameters<FP, WIDTH>,
impl<FP, AF, ILBP, const WIDTH: usize> GenericPoseidon2LinearLayers<AF, WIDTH> for GenericPoseidon2LinearLayersMonty31<FP, ILBP>where
FP: FieldParameters,
AF: AbstractField + Mul<MontyField31<FP>, Output = AF>,
ILBP: InternalLayerBaseParameters<FP, WIDTH>,
Source§fn internal_linear_layer(state: &mut [AF; WIDTH])
fn internal_linear_layer(state: &mut [AF; WIDTH])
Perform the external matrix multiplication for any Abstract field which implements multiplication by MontyField31 elements.
Source§fn external_linear_layer(state: &mut [AF; WIDTH])
fn external_linear_layer(state: &mut [AF; WIDTH])
A generic implementation of the external linear layer.
Auto Trait Implementations§
impl<FP, ILBP> Freeze for GenericPoseidon2LinearLayersMonty31<FP, ILBP>
impl<FP, ILBP> RefUnwindSafe for GenericPoseidon2LinearLayersMonty31<FP, ILBP>where
FP: RefUnwindSafe,
ILBP: RefUnwindSafe,
impl<FP, ILBP> Send for GenericPoseidon2LinearLayersMonty31<FP, ILBP>
impl<FP, ILBP> Sync for GenericPoseidon2LinearLayersMonty31<FP, ILBP>
impl<FP, ILBP> Unpin for GenericPoseidon2LinearLayersMonty31<FP, ILBP>
impl<FP, ILBP> UnwindSafe for GenericPoseidon2LinearLayersMonty31<FP, ILBP>where
FP: UnwindSafe,
ILBP: UnwindSafe,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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