anemoi::ed_on_bls12_377::anemoi_4_3

Struct AnemoiEdOnBls12_377_4_3

Source
pub struct AnemoiEdOnBls12_377_4_3;
Expand description

An Anemoi instantiation over BLS_12_377 scalarfield with 2 columns and rate 3.

Trait Implementations§

Source§

impl<'a> Anemoi<'a, Fp<MontBackend<FrConfig, 4>, 4>> for AnemoiEdOnBls12_377_4_3

Source§

const NUM_COLUMNS: usize = 2usize

Number of columns of this Anemoi instance.
Source§

const NUM_ROUNDS: usize = 13usize

Number of rounds of this Anemoi instance.
Source§

const WIDTH: usize = 4usize

Width of this Anemoi instance. Should always be equal to twice the number of columns.
Source§

const RATE: usize = 3usize

The rate of this Anemoi instance when used in Sponge mode.
Source§

const OUTPUT_SIZE: usize = 1usize

The output size of this Anemoi instance, in both Sponge or Jive mode.
Source§

const ARK_C: &'a [Felt]

The first set of additive round constants (C) used for this Anemoi instance.
Source§

const ARK_D: &'a [Felt]

The first set of additive round constants (D) used for this Anemoi instance.
Source§

const GROUP_GENERATOR: u32 = 22u32

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 ALPHA: u32 = 11u32

The alpha exponent used for this Anemoi instance’s S-Box layer.
Source§

const INV_ALPHA: Felt = sbox::INV_ALPHA

The inv_alpha exponent used for this Anemoi instance’s S-Box layer.
Source§

const BETA: u32 = 22u32

The beta constant used for this Anemoi instance’s S-Box layer.
Source§

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

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

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

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

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

Helper method to exponentiate by this Anemoi instance’s ALPHA parameter.
Source§

fn ark_layer(state: &mut [F], round_ctr: usize)

Additive Round Constants (ARK) layer.
Source§

fn mds_layer(state: &mut [F])

Linear layer.
Source§

fn mds_internal(state: &mut [F])

Utility method for the mds_layer.
Source§

fn sbox_layer(state: &mut [F])

The S-Box layer.
Source§

fn round(state: &mut [F], round_ctr: usize)

A full round of a permutation for this Anemoi instance.
Source§

fn permutation(state: &mut [F])

An entire permutation for this Anemoi instance.
Source§

impl Clone for AnemoiEdOnBls12_377_4_3

Source§

fn clone(&self) -> AnemoiEdOnBls12_377_4_3

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AnemoiEdOnBls12_377_4_3

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Jive<Fp<MontBackend<FrConfig, 4>, 4>> for AnemoiEdOnBls12_377_4_3

Source§

fn compress(elems: &[Felt]) -> Vec<Felt>

Compresses the provided field element slice as input by 2. Read more
Source§

fn compress_k(elems: &[Felt], k: usize) -> Vec<Felt>

Compresses the provided field element slice as input by a factor k. Read more
Source§

impl Sponge<Fp<MontBackend<FrConfig, 4>, 4>> for AnemoiEdOnBls12_377_4_3

Source§

type Digest = AnemoiDigest

Specifies a digest type returned by this hasher.
Source§

fn hash(bytes: &[u8]) -> Self::Digest

Returns a hash of the provided sequence of bytes.
Source§

fn hash_field(elems: &[Felt]) -> Self::Digest

Returns a hash of the provided sequence of field elements.
Source§

fn merge(digests: &[Self::Digest; 2]) -> Self::Digest

Compresses two given digests into one.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V