pub trait InternalLayerBaseParameters<MP: MontyParameters, const WIDTH: usize>: Clone + Sync {
// Required method
fn internal_layer_mat_mul<R: PrimeCharacteristicRing>(
state: &mut [R; WIDTH],
sum: R,
);
// Provided method
fn generic_internal_linear_layer<R: PrimeCharacteristicRing>(
state: &mut [R; WIDTH],
) { ... }
}Expand description
Trait which handles the Poseidon2 internal layers.
Everything needed to compute multiplication by a WIDTH x WIDTH diffusion matrix whose monty form is 1 + Diag(vec).
vec is assumed to be of the form [-2, ...] with all entries after the first being small powers of 2.
Required Methods§
Sourcefn internal_layer_mat_mul<R: PrimeCharacteristicRing>(
state: &mut [R; WIDTH],
sum: R,
)
fn internal_layer_mat_mul<R: PrimeCharacteristicRing>( state: &mut [R; WIDTH], sum: R, )
Perform the internal matrix multiplication: s -> (1 + Diag(V))s.
We ignore state[0] as it is handled separately.
Provided Methods§
Sourcefn generic_internal_linear_layer<R: PrimeCharacteristicRing>(
state: &mut [R; WIDTH],
)
fn generic_internal_linear_layer<R: PrimeCharacteristicRing>( state: &mut [R; WIDTH], )
Perform the matrix multiplication corresponding to the internal linear layer.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".