pub struct AnemoiVesta_2_1;
Expand description
An Anemoi instantiation over Vesta basefield with 1 column and rate 1.
Trait Implementations§
Source§impl<'a> Anemoi<'a, Fp<MontBackend<FrConfig, 4>, 4>> for AnemoiVesta_2_1
impl<'a> Anemoi<'a, Fp<MontBackend<FrConfig, 4>, 4>> for AnemoiVesta_2_1
Source§const NUM_COLUMNS: usize = 1usize
const NUM_COLUMNS: usize = 1usize
Number of columns of this Anemoi instance.
Source§const NUM_ROUNDS: usize = 21usize
const NUM_ROUNDS: usize = 21usize
Number of rounds of this Anemoi instance.
Source§const WIDTH: usize = 2usize
const WIDTH: usize = 2usize
Width of this Anemoi instance. Should always be equal to
twice the number of columns.
Source§const OUTPUT_SIZE: usize = 1usize
const OUTPUT_SIZE: usize = 1usize
The output size of this Anemoi instance, in both Sponge or Jive mode.
Source§const ARK_C: &'a [Felt]
const ARK_C: &'a [Felt]
The first set of additive round constants (C) used for this Anemoi instance.
Source§const ARK_D: &'a [Felt]
const ARK_D: &'a [Felt]
The first set of additive round constants (D) used for this Anemoi instance.
Source§const GROUP_GENERATOR: u32 = 5u32
const GROUP_GENERATOR: u32 = 5u32
The group generator of the underlying field of this Anemoi instance. It is defined
to possibly speed up the MDS layer for small instances.
Source§const INV_ALPHA: Felt = sbox::INV_ALPHA
const INV_ALPHA: Felt = sbox::INV_ALPHA
The inv_alpha exponent used for this Anemoi instance’s S-Box layer.
Source§const DELTA: Felt = sbox::DELTA
const DELTA: Felt = sbox::DELTA
The delta constant used for this Anemoi instance’s S-Box layer.
Source§fn exp_by_inv_alpha(x: Felt) -> Felt
fn exp_by_inv_alpha(x: Felt) -> Felt
Helper method to exponentiate by this Anemoi instance’s
INV_ALPHA
parameter.
It is left to implementors to provide efficient multiplication chains.Source§const MDS: Option<&'a [F]> = None
const MDS: Option<&'a [F]> = None
The MDS matrix used for this Anemoi instance’s linear layer. It is optional
as short instances benefit from a custom low-cost matrix-vector product for the
Anemoi linear layer.
Source§const QUAD: u32 = 2u32
const QUAD: u32 = 2u32
The quadratic factor used for this Anemoi instance’s S-Box layer. Binary fields are not
supported here, hence it is always set to 2.
Source§fn mul_by_generator(x: &F) -> F
fn mul_by_generator(x: &F) -> F
Helper method to possibly speed-up the linear layer.
It is also used by the S-Box layer as
Self::BETA
is defined as the generator.Source§fn exp_by_alpha(x: F) -> F
fn exp_by_alpha(x: F) -> F
Helper method to exponentiate by this Anemoi instance’s
ALPHA
parameter.Source§fn mds_internal(state: &mut [F])
fn mds_internal(state: &mut [F])
Utility method for the mds_layer.
Source§fn sbox_layer(state: &mut [F])
fn sbox_layer(state: &mut [F])
The S-Box layer.
Source§fn round(state: &mut [F], round_ctr: usize)
fn round(state: &mut [F], round_ctr: usize)
A full round of a permutation for this Anemoi instance.
Source§fn permutation(state: &mut [F])
fn permutation(state: &mut [F])
An entire permutation for this Anemoi instance.
Source§impl Clone for AnemoiVesta_2_1
impl Clone for AnemoiVesta_2_1
Source§fn clone(&self) -> AnemoiVesta_2_1
fn clone(&self) -> AnemoiVesta_2_1
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 moreSource§impl Debug for AnemoiVesta_2_1
impl Debug for AnemoiVesta_2_1
Source§impl Jive<Fp<MontBackend<FrConfig, 4>, 4>> for AnemoiVesta_2_1
impl Jive<Fp<MontBackend<FrConfig, 4>, 4>> for AnemoiVesta_2_1
Source§impl Sponge<Fp<MontBackend<FrConfig, 4>, 4>> for AnemoiVesta_2_1
impl Sponge<Fp<MontBackend<FrConfig, 4>, 4>> for AnemoiVesta_2_1
Source§type Digest = AnemoiDigest
type Digest = AnemoiDigest
Specifies a digest type returned by this hasher.
Source§fn hash_field(elems: &[Felt]) -> Self::Digest
fn hash_field(elems: &[Felt]) -> Self::Digest
Returns a hash of the provided sequence of field elements.
Auto Trait Implementations§
impl Freeze for AnemoiVesta_2_1
impl RefUnwindSafe for AnemoiVesta_2_1
impl Send for AnemoiVesta_2_1
impl Sync for AnemoiVesta_2_1
impl Unpin for AnemoiVesta_2_1
impl UnwindSafe for AnemoiVesta_2_1
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,
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