p3_monty_31

Struct MontyField31

Source
pub struct MontyField31<MP: MontyParameters> { /* private fields */ }

Implementations§

Source§

impl<MP: MontyParameters + TwoAdicData> MontyField31<MP>

Source

pub fn backward_fft(a: &mut [Self], root_table: &[Vec<Self>])

Source§

impl<MP: FieldParameters + TwoAdicData> MontyField31<MP>

Source

pub fn roots_of_unity_table(n: usize) -> Vec<Vec<Self>>

Given a field element gen of order n where n = 2^lg_n, return a vector of vectors table where table[i] is the vector of twiddle factors for an fft of length n/2^i. The values gen^0 = 1 are skipped, as are g_i^k for k >= i/2 as these are just the negatives of the other roots (using g_i^{i/2} = -1).

Source§

impl<MP: MontyParameters + TwoAdicData> MontyField31<MP>

Source

pub fn forward_fft(a: &mut [Self], root_table: &[Vec<Self>])

Source§

impl<MP: MontyParameters> MontyField31<MP>

Source

pub const fn new(value: u32) -> Self

Source

pub const fn new_array<const N: usize>(input: [u32; N]) -> [Self; N]

Convert a constant u32 array into a constant array of field elements. Constant version of array.map(MontyField31::new).

Source

pub const fn new_2d_array<const N: usize, const M: usize>( input: [[u32; N]; M], ) -> [[Self; N]; M]

Convert a constant 2d u32 array into a constant 2d array of field elements. Constant version of array.map(MontyField31::new_array).

Source

pub const fn mul_2exp_neg_n(&self, n: u32) -> Self

Multiply the given MontyField31 element by 2^{-n}.

This makes use of the fact that, as the monty constant is 2^32, the monty form of 2^{-n} is 2^{32 - n}. Monty reduction works provided the input is < 2^32P so this works for 0 <= n <= 32.

Trait Implementations§

Source§

impl<FP: FieldParameters> AbstractField for MontyField31<FP>

Source§

const ZERO: Self = FP::MONTY_ZERO

Source§

const ONE: Self = FP::MONTY_ONE

Source§

const TWO: Self = FP::MONTY_TWO

Source§

const NEG_ONE: Self = FP::MONTY_NEG_ONE

Source§

type F = MontyField31<FP>

Source§

fn from_f(f: Self::F) -> Self

Source§

fn from_bool(b: bool) -> Self

Convert from a bool.
Source§

fn from_canonical_u8(n: u8) -> Self

Convert from a canonical u8. Read more
Source§

fn from_canonical_u16(n: u16) -> Self

Convert from a canonical u16. Read more
Source§

fn from_canonical_u32(n: u32) -> Self

Convert from a canonical u32. Read more
Source§

fn from_canonical_u64(n: u64) -> Self

Convert from a canonical u64. Read more
Source§

fn from_canonical_usize(n: usize) -> Self

Convert from a canonical usize. Read more
Source§

fn from_wrapped_u32(n: u32) -> Self

Source§

fn from_wrapped_u64(n: u64) -> Self

Source§

fn mul_2exp_u64(&self, exp: u64) -> Self

self * 2^exp
Source§

fn zero_vec(len: usize) -> Vec<Self>

Allocates a vector of zero elements of length len. Many operating systems zero pages before assigning them to a userspace process. In that case, our process should not need to write zeros, which would be redundant. However, the compiler may not always recognize this. Read more
Source§

fn double(&self) -> Self

Source§

fn square(&self) -> Self

Source§

fn cube(&self) -> Self

Source§

fn exp_u64(&self, power: u64) -> Self

Exponentiation by a u64 power. Read more
Source§

fn exp_const_u64<const POWER: u64>(&self) -> Self

Source§

fn exp_power_of_2(&self, power_log: usize) -> Self

Source§

fn powers(&self) -> Powers<Self>

Source§

fn shifted_powers(&self, start: Self) -> Powers<Self>

Source§

fn powers_packed<P>(&self) -> PackedPowers<Self, P>
where P: PackedField<Scalar = Self>,

Source§

fn shifted_powers_packed<P>(&self, start: Self) -> PackedPowers<Self, P>
where P: PackedField<Scalar = Self>,

Source§

fn dot_product<const N: usize>(u: &[Self; N], v: &[Self; N]) -> Self

Source§

fn try_div<Rhs>(self, rhs: Rhs) -> Option<Self::Output>
where Rhs: Field, Self: Mul<Rhs>,

Source§

impl<PMP: PackedMontyParameters> Add<MontyField31<PMP>> for PackedMontyField31Neon<PMP>

Source§

type Output = PackedMontyField31Neon<PMP>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: MontyField31<PMP>) -> Self

Performs the + operation. Read more
Source§

impl<PMP: PackedMontyParameters> Add<PackedMontyField31Neon<PMP>> for MontyField31<PMP>

Source§

type Output = PackedMontyField31Neon<PMP>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: PackedMontyField31Neon<PMP>) -> PackedMontyField31Neon<PMP>

Performs the + operation. Read more
Source§

impl<FP: MontyParameters> Add for MontyField31<FP>

Source§

type Output = MontyField31<FP>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self

Performs the + operation. Read more
Source§

impl<PMP: PackedMontyParameters> AddAssign<MontyField31<PMP>> for PackedMontyField31Neon<PMP>

Source§

fn add_assign(&mut self, rhs: MontyField31<PMP>)

Performs the += operation. Read more
Source§

impl<FP: MontyParameters> AddAssign for MontyField31<FP>

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<const WIDTH: usize, FP> BinomiallyExtendable<WIDTH> for MontyField31<FP>

Source§

const W: Self = _

Source§

const DTH_ROOT: Self = _

Source§

const EXT_GENERATOR: [Self; WIDTH] = FP::EXT_GENERATOR

Source§

impl<MP: Clone + MontyParameters> Clone for MontyField31<MP>

Source§

fn clone(&self) -> MontyField31<MP>

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<FP: MontyParameters> Debug for MontyField31<FP>

Source§

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

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

impl<MP: Default + MontyParameters> Default for MontyField31<MP>

Source§

fn default() -> MontyField31<MP>

Returns the “default value” for a type. Read more
Source§

impl<'de, FP: FieldParameters> Deserialize<'de> for MontyField31<FP>

Source§

fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<FP: MontyParameters> Display for MontyField31<FP>

Source§

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

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

impl<FP: MontyParameters> Distribution<MontyField31<FP>> for Standard

Source§

fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> MontyField31<FP>

Generate a random value of T, using rng as the source of randomness.
Source§

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
Source§

fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more
Source§

impl<FP: FieldParameters> Div<MontyField31<FP>> for PackedMontyField31Neon<FP>

Source§

type Output = PackedMontyField31Neon<FP>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: MontyField31<FP>) -> Self

Performs the / operation. Read more
Source§

impl<FP: FieldParameters> Div for MontyField31<FP>

Source§

type Output = MontyField31<FP>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Self) -> Self

Performs the / operation. Read more
Source§

impl<FP, const WIDTH: usize, const D: u64> ExternalLayer<MontyField31<FP>, WIDTH, D> for Poseidon2ExternalLayerMonty31<FP, WIDTH>
where FP: FieldParameters,

Source§

fn permute_state_initial(&self, state: &mut [MontyField31<FP>; WIDTH])

Perform the initial external layers of the Poseidon2 permutation on the given state.

Source§

fn permute_state_terminal(&self, state: &mut [MontyField31<FP>; WIDTH])

Perform the terminal external layers of the Poseidon2 permutation on the given state.

Source§

impl<FP: FieldParameters> Field for MontyField31<FP>

Source§

const GENERATOR: Self = FP::MONTY_GEN

A generator of this field’s entire multiplicative group.
Source§

type Packing = PackedMontyField31Neon<FP>

Source§

fn exp_u64_generic<AF: AbstractField<F = Self>>(val: AF, power: u64) -> AF

Exponentiation by a u64 power. This is similar to exp_u64, but more general in that it can be used with AbstractFields, not just this concrete field. Read more
Source§

fn try_inverse(&self) -> Option<Self>

The multiplicative inverse of this field element, if it exists. Read more
Source§

fn halve(&self) -> Self

Computes input/2. Should be overwritten by most field implementations to use bitshifts. Will error if the field characteristic is 2.
Source§

fn order() -> BigUint

Source§

fn is_zero(&self) -> bool

Source§

fn is_one(&self) -> bool

Source§

fn div_2exp_u64(&self, exp: u64) -> Self

self / 2^exp
Source§

fn inverse(&self) -> Self

Source§

fn multiplicative_group_factors() -> Vec<(BigUint, usize)>

A list of (factor, exponent) pairs.
Source§

fn bits() -> usize

Source§

impl<PMP: PackedMontyParameters> From<MontyField31<PMP>> for PackedMontyField31Neon<PMP>

Source§

fn from(value: MontyField31<PMP>) -> Self

Converts to this type from the input type.
Source§

impl<const WIDTH: usize, FP> HasTwoAdicBionmialExtension<WIDTH> for MontyField31<FP>

Source§

const EXT_TWO_ADICITY: usize = _

Source§

fn ext_two_adic_generator(bits: usize) -> [Self; WIDTH]

Assumes the multiplicative group size has at least bits powers of two, otherwise the behavior is undefined.
Source§

impl<MP: Hash + MontyParameters> Hash for MontyField31<MP>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<FP, const WIDTH: usize, P2P, const D: u64> InternalLayer<MontyField31<FP>, WIDTH, D> for Poseidon2InternalLayerMonty31<FP, WIDTH, P2P>
where FP: FieldParameters, P2P: InternalLayerParameters<FP, WIDTH>,

Source§

fn permute_state(&self, state: &mut [MontyField31<FP>; WIDTH])

Perform the internal layers of the Poseidon2 permutation on the given state.

Source§

impl<PMP: PackedMontyParameters> Mul<MontyField31<PMP>> for PackedMontyField31Neon<PMP>

Source§

type Output = PackedMontyField31Neon<PMP>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: MontyField31<PMP>) -> Self

Performs the * operation. Read more
Source§

impl<PMP: PackedMontyParameters> Mul<PackedMontyField31Neon<PMP>> for MontyField31<PMP>

Source§

type Output = PackedMontyField31Neon<PMP>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: PackedMontyField31Neon<PMP>) -> PackedMontyField31Neon<PMP>

Performs the * operation. Read more
Source§

impl<FP: MontyParameters> Mul for MontyField31<FP>

Source§

type Output = MontyField31<FP>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self

Performs the * operation. Read more
Source§

impl<PMP: PackedMontyParameters> MulAssign<MontyField31<PMP>> for PackedMontyField31Neon<PMP>

Source§

fn mul_assign(&mut self, rhs: MontyField31<PMP>)

Performs the *= operation. Read more
Source§

impl<FP: MontyParameters> MulAssign for MontyField31<FP>

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl<FP: FieldParameters> Neg for MontyField31<FP>

Source§

type Output = MontyField31<FP>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<FP: MontyParameters> Ord for MontyField31<FP>

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<MP: PartialEq + MontyParameters> PartialEq for MontyField31<MP>

Source§

fn eq(&self, other: &MontyField31<MP>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<FP: MontyParameters> PartialOrd for MontyField31<FP>

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<FP: FieldParameters> PrimeField for MontyField31<FP>

Source§

impl<FP: FieldParameters> PrimeField32 for MontyField31<FP>

Source§

const ORDER_U32: u32 = FP::PRIME

Source§

fn as_canonical_u32(&self) -> u32

Return the representative of value that is less than ORDER_U32.
Source§

impl<FP: FieldParameters> PrimeField64 for MontyField31<FP>

Source§

const ORDER_U64: u64 = _

Source§

fn as_canonical_u64(&self) -> u64

Return the representative of value that is less than ORDER_U64.
Source§

impl<FP: FieldParameters> Product<MontyField31<FP>> for PackedMontyField31Neon<FP>

Source§

fn product<I>(iter: I) -> Self
where I: Iterator<Item = MontyField31<FP>>,

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl<FP: FieldParameters> Product for MontyField31<FP>

Source§

fn product<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by multiplying the items.
Source§

impl<FP: FieldParameters> Serialize for MontyField31<FP>

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

Serialize this value into the given Serde serializer. Read more
Source§

impl<PMP: PackedMontyParameters> Sub<MontyField31<PMP>> for PackedMontyField31Neon<PMP>

Source§

type Output = PackedMontyField31Neon<PMP>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: MontyField31<PMP>) -> Self

Performs the - operation. Read more
Source§

impl<PMP: PackedMontyParameters> Sub<PackedMontyField31Neon<PMP>> for MontyField31<PMP>

Source§

type Output = PackedMontyField31Neon<PMP>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: PackedMontyField31Neon<PMP>) -> PackedMontyField31Neon<PMP>

Performs the - operation. Read more
Source§

impl<FP: MontyParameters> Sub for MontyField31<FP>

Source§

type Output = MontyField31<FP>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self

Performs the - operation. Read more
Source§

impl<PMP: PackedMontyParameters> SubAssign<MontyField31<PMP>> for PackedMontyField31Neon<PMP>

Source§

fn sub_assign(&mut self, rhs: MontyField31<PMP>)

Performs the -= operation. Read more
Source§

impl<FP: MontyParameters> SubAssign for MontyField31<FP>

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<FP: FieldParameters> Sum<MontyField31<FP>> for PackedMontyField31Neon<FP>

Source§

fn sum<I>(iter: I) -> Self
where I: Iterator<Item = MontyField31<FP>>,

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<FP: MontyParameters> Sum for MontyField31<FP>

Source§

fn sum<I: Iterator<Item = Self>>(iter: I) -> Self

Takes an iterator and generates Self from the elements by “summing up” the items.
Source§

impl<FP: FieldParameters + TwoAdicData> TwoAdicField for MontyField31<FP>

Source§

const TWO_ADICITY: usize = FP::TWO_ADICITY

The number of factors of two in this field’s multiplicative group.
Source§

fn two_adic_generator(bits: usize) -> Self

Returns a generator of the multiplicative group of order 2^bits. Assumes bits <= TWO_ADICITY, otherwise the result is undefined.
Source§

impl<MP: MontyParameters + FieldParameters + TwoAdicData> TwoAdicSubgroupDft<MontyField31<MP>> for RecursiveDft<MontyField31<MP>>

DFT implementation that uses DIT for the inverse “backward” direction and DIF for the “forward” direction.

The API mandates that the LDE is applied column-wise on the row-major input. This is awkward for memory coherence, so the algorithm here transposes the input and operates on the rows in the typical way, then transposes back again for the output. Even for modestly large inputs, the cost of the two tranposes outweighed by the improved performance from operating row-wise.

The choice of DIT for inverse and DIF for “forward” transform mean that a (coset) LDE

  • IDFT / zero extend / DFT

expands to

  • bit-reverse input
  • invDFT DIT
    • result is in “correct” order
  • coset shift and zero extend result
  • DFT DIF on result
    • output is bit-reversed, as required for FRI.

Hence the only bit-reversal that needs to take place is on the input.

Source§

type Evaluations = RowIndexMappedView<BitReversalPerm, DenseMatrix<MontyField31<MP>>>

Source§

fn dft_batch(&self, mat: RowMajorMatrix<MontyField31<MP>>) -> Self::Evaluations

Compute the discrete Fourier transform (DFT) of each column in mat. This is the only method an implementer needs to define, all other methods can be derived from this one.
Source§

fn idft_batch( &self, mat: RowMajorMatrix<MontyField31<MP>>, ) -> RowMajorMatrix<MontyField31<MP>>

Compute the inverse DFT of each column in mat.
Source§

fn coset_lde_batch( &self, mat: RowMajorMatrix<MontyField31<MP>>, added_bits: usize, shift: MontyField31<MP>, ) -> Self::Evaluations

Compute the low-degree extension of each column in mat onto a coset of a larger subgroup.
Source§

fn dft(&self, vec: Vec<F>) -> Vec<F>

Compute the discrete Fourier transform (DFT) vec.
Source§

fn coset_dft(&self, vec: Vec<F>, shift: F) -> Vec<F>

Compute the “coset DFT” of vec. This can be viewed as interpolation onto a coset of a multiplicative subgroup, rather than the subgroup itself.
Source§

fn coset_dft_batch(&self, mat: DenseMatrix<F>, shift: F) -> Self::Evaluations

Compute the “coset DFT” of each column in mat. This can be viewed as interpolation onto a coset of a multiplicative subgroup, rather than the subgroup itself.
Source§

fn idft(&self, vec: Vec<F>) -> Vec<F>

Compute the inverse DFT of vec.
Source§

fn coset_idft(&self, vec: Vec<F>, shift: F) -> Vec<F>

Compute the “coset iDFT” of vec. This can be viewed as an inverse operation of “coset DFT”, that interpolates over a coset of a multiplicative subgroup, rather than subgroup itself.
Source§

fn coset_idft_batch(&self, mat: DenseMatrix<F>, shift: F) -> DenseMatrix<F>

Compute the “coset iDFT” of each column in mat. This can be viewed as an inverse operation of “coset DFT”, that interpolates over a coset of a multiplicative subgroup, rather than the subgroup itself.
Source§

fn lde(&self, vec: Vec<F>, added_bits: usize) -> Vec<F>

Compute the low-degree extension of vec onto a larger subgroup.
Source§

fn lde_batch(&self, mat: DenseMatrix<F>, added_bits: usize) -> Self::Evaluations

Compute the low-degree extension of each column in mat onto a larger subgroup.
Source§

fn coset_lde(&self, vec: Vec<F>, added_bits: usize, shift: F) -> Vec<F>

Compute the low-degree extension of each column in mat onto a coset of a larger subgroup.
Source§

impl<MP: Copy + MontyParameters> Copy for MontyField31<MP>

Source§

impl<MP: Eq + MontyParameters> Eq for MontyField31<MP>

Source§

impl<FP: MontyParameters, MU: MDSUtils> MdsPermutation<MontyField31<FP>, 12> for MdsMatrixMontyField31<MU>

Source§

impl<FP: MontyParameters, MU: MDSUtils> MdsPermutation<MontyField31<FP>, 16> for MdsMatrixMontyField31<MU>

Source§

impl<FP: BarrettParameters, MU: MDSUtils> MdsPermutation<MontyField31<FP>, 24> for MdsMatrixMontyField31<MU>

Source§

impl<FP: BarrettParameters, MU: MDSUtils> MdsPermutation<MontyField31<FP>, 32> for MdsMatrixMontyField31<MU>

Source§

impl<FP: BarrettParameters, MU: MDSUtils> MdsPermutation<MontyField31<FP>, 64> for MdsMatrixMontyField31<MU>

Source§

impl<FP: MontyParameters, MU: MDSUtils> MdsPermutation<MontyField31<FP>, 8> for MdsMatrixMontyField31<MU>

Source§

impl<FP: FieldParameters> Packable for MontyField31<FP>

Source§

impl<MP: MontyParameters> StructuralPartialEq for MontyField31<MP>

Auto Trait Implementations§

§

impl<MP> Freeze for MontyField31<MP>

§

impl<MP> RefUnwindSafe for MontyField31<MP>
where MP: RefUnwindSafe,

§

impl<MP> Send for MontyField31<MP>

§

impl<MP> Sync for MontyField31<MP>

§

impl<MP> Unpin for MontyField31<MP>
where MP: Unpin,

§

impl<MP> UnwindSafe for MontyField31<MP>
where MP: UnwindSafe,

Blanket Implementations§

Source§

impl<AF> AbstractExtensionField<AF> for AF
where AF: AbstractField,

Source§

const D: usize = 1usize

Source§

fn from_base(b: AF) -> AF

Source§

fn from_base_slice(bs: &[AF]) -> AF

Suppose this field extension is represented by the quotient ring B[X]/(f(X)) where B is Base and f is an irreducible polynomial of degree D. This function takes a slice bs of length at exactly D, and constructs the field element \sum_i bs[i] * X^i. Read more
Source§

fn from_base_iter<I>(iter: I) -> AF
where I: Iterator<Item = AF>,

Source§

fn from_base_fn<F>(f: F) -> AF
where F: FnMut(usize) -> AF,

Similar to core:array::from_fn, with the same caveats as from_base_slice.
Source§

fn as_base_slice(&self) -> &[AF]

Suppose this field extension is represented by the quotient ring B[X]/(f(X)) where B is Base and f is an irreducible polynomial of degree D. This function takes a field element \sum_i bs[i] * X^i and returns the coefficients as a slice bs of length at most D containing, from lowest degree to highest. Read more
Source§

fn monomial(exponent: usize) -> Self

Suppose this field extension is represented by the quotient ring B[X]/(f(X)) where B is Base and f is an irreducible polynomial of degree D. This function returns the field element X^exponent if exponent < D and panics otherwise. (The fact that f is not known at the point that this function is defined prevents implementing exponentiation of higher powers since the reduction cannot be performed.) Read more
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 T)

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

impl<F> ExtensionField<F> for F
where F: Field,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<F> PackedField for F
where F: Field,

Source§

impl<F> PackedFieldPow2 for F
where F: Field,

Source§

fn interleave(&self, other: F, block_len: usize) -> (F, F)

Take interpret two vectors as chunks of block_len elements. Unpack and interleave those chunks. This is best seen with an example. If we have: Read more
Source§

impl<T> PackedValue for T
where T: Packable,

Source§

const WIDTH: usize = 1usize

Source§

type Value = T

Source§

fn from_slice(slice: &[<T as PackedValue>::Value]) -> &T

Source§

fn from_slice_mut(slice: &mut [<T as PackedValue>::Value]) -> &mut T

Source§

fn from_fn<Fn>(f: Fn) -> T
where Fn: FnMut(usize) -> <T as PackedValue>::Value,

Similar to core:array::from_fn.
Source§

fn as_slice(&self) -> &[<T as PackedValue>::Value]

Source§

fn as_slice_mut(&mut self) -> &mut [<T as PackedValue>::Value]

Source§

fn pack_slice(buf: &[Self::Value]) -> &[Self]

Source§

fn pack_slice_with_suffix(buf: &[Self::Value]) -> (&[Self], &[Self::Value])

Source§

fn pack_slice_mut(buf: &mut [Self::Value]) -> &mut [Self]

Source§

fn pack_maybe_uninit_slice_mut( buf: &mut [MaybeUninit<Self::Value>], ) -> &mut [MaybeUninit<Self>]

Source§

fn pack_slice_with_suffix_mut( buf: &mut [Self::Value], ) -> (&mut [Self], &mut [Self::Value])

Source§

fn pack_maybe_uninit_slice_with_suffix_mut( buf: &mut [MaybeUninit<Self::Value>], ) -> (&mut [MaybeUninit<Self>], &mut [MaybeUninit<Self::Value>])

Source§

fn unpack_slice(buf: &[Self]) -> &[Self::Value]

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. 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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,