ark_bn254::fr

Struct FrConfig

Source
pub struct FrConfig;

Trait Implementations§

Source§

impl MontConfig<4> for FrConfig

Source§

fn neg_in_place(a: &mut Fp<MontBackend<FrConfig, 4usize>, 4usize>)

Sets a = -a.

Source§

const MODULUS: BigInt<4usize> = _

The modulus of the field.
Source§

const GENERATOR: Fp<MontBackend<FrConfig, 4usize>, 4usize> = _

A multiplicative generator of the field. Self::GENERATOR is an element having multiplicative order Self::MODULUS - 1.
Source§

const TWO_ADIC_ROOT_OF_UNITY: Fp<MontBackend<FrConfig, 4usize>, 4usize> = _

2^s root of unity computed by GENERATOR^t
Source§

const SMALL_SUBGROUP_BASE: Option<u32> = _

An integer b such that there exists a multiplicative subgroup of size b^k for some integer k.
Source§

const SMALL_SUBGROUP_BASE_ADICITY: Option<u32> = _

The integer k such that there exists a multiplicative subgroup of size Self::SMALL_SUBGROUP_BASE^k.
Source§

const LARGE_SUBGROUP_ROOT_OF_UNITY: Option<Fp<MontBackend<FrConfig, 4usize>, 4usize>> = _

GENERATOR^((MODULUS-1) / (2^s * SMALL_SUBGROUP_BASE^SMALL_SUBGROUP_BASE_ADICITY)). Used for mixed-radix FFT.
Source§

fn add_assign( a: &mut Fp<MontBackend<FrConfig, 4usize>, 4usize>, b: &Fp<MontBackend<FrConfig, 4usize>, 4usize>, )

Sets a = a + b.
Source§

fn sub_assign( a: &mut Fp<MontBackend<FrConfig, 4usize>, 4usize>, b: &Fp<MontBackend<FrConfig, 4usize>, 4usize>, )

Sets a = a - b.
Source§

fn double_in_place(a: &mut Fp<MontBackend<FrConfig, 4usize>, 4usize>)

Sets a = 2 * a.
Source§

fn mul_assign( a: &mut Fp<MontBackend<FrConfig, 4usize>, 4usize>, b: &Fp<MontBackend<FrConfig, 4usize>, 4usize>, )

This modular multiplication algorithm uses Montgomery reduction for efficient implementation. It also additionally uses the “no-carry optimization” outlined here if Self::MODULUS has (a) a non-zero MSB, and (b) at least one zero bit in the rest of the modulus.
Source§

fn square_in_place(a: &mut Fp<MontBackend<FrConfig, 4usize>, 4usize>)

Source§

fn sum_of_products<const M: usize>( a: &[Fp<MontBackend<FrConfig, 4usize>, 4usize>; M], b: &[Fp<MontBackend<FrConfig, 4usize>, 4usize>; M], ) -> Fp<MontBackend<FrConfig, 4usize>, 4usize>

Source§

const R: BigInt<N> = _

Let M be the power of 2^64 nearest to Self::MODULUS_BITS. Then R = M % Self::MODULUS.
Source§

const R2: BigInt<N> = _

R2 = R^2 % Self::MODULUS
Source§

const INV: u64 = _

INV = -MODULUS^{-1} mod 2^64
Source§

const SQRT_PRECOMP: Option<SqrtPrecomputation<Fp<MontBackend<Self, N>, N>>> = _

Precomputed material for use when computing square roots. The default is to use the standard Tonelli-Shanks algorithm.
Source§

fn inverse( a: &Fp<MontBackend<Self, N>, N>, ) -> Option<Fp<MontBackend<Self, N>, N>>

Source§

fn from_bigint(r: BigInt<N>) -> Option<Fp<MontBackend<Self, N>, N>>

Source§

fn into_bigint(a: Fp<MontBackend<Self, N>, N>) -> BigInt<N>

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> 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, 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