pub struct MontyField31<MP: MontyParameters> { /* private fields */ }Implementations§
Source§impl<MP: FieldParameters + TwoAdicData> MontyField31<MP>
impl<MP: FieldParameters + TwoAdicData> MontyField31<MP>
pub fn backward_fft(input: &mut [Self], root_table: &[Vec<Self>])
Source§impl<MP: FieldParameters + TwoAdicData> MontyField31<MP>
impl<MP: FieldParameters + TwoAdicData> MontyField31<MP>
Sourcepub fn roots_of_unity_table(n: usize) -> Vec<Vec<Self>>
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 g_i^k for k >= i/2 are skipped as these are just the
negatives of the other roots (using g_i^{i/2} = -1). The
value gen^0 = 1 is included to aid consistency between the
packed and non-packed variants.
pub fn get_missing_twiddles(req_lg_n: usize, cur_lg_n: usize) -> Vec<Vec<Self>>
Source§impl<MP: FieldParameters + TwoAdicData> MontyField31<MP>
impl<MP: FieldParameters + TwoAdicData> MontyField31<MP>
pub fn forward_fft(input: &mut [Self], root_table: &[Vec<Self>])
Source§impl<MP: MontyParameters> MontyField31<MP>
impl<MP: MontyParameters> MontyField31<MP>
Sourcepub const fn new(value: u32) -> Self
pub const fn new(value: u32) -> Self
The standard way to create a new element.
Note that new converts the input into MONTY form so should be avoided in performance critical implementations.
Trait Implementations§
Source§impl<FP: MontyParameters> Add for MontyField31<FP>
impl<FP: MontyParameters> Add for MontyField31<FP>
Source§impl<MP: MontyParameters, T: Into<Self>> AddAssign<T> for MontyField31<MP>
impl<MP: MontyParameters, T: Into<Self>> AddAssign<T> for MontyField31<MP>
Source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
+= operation. Read moreSource§impl<const WIDTH: usize, FP> BinomiallyExtendable<WIDTH> for MontyField31<FP>where
FP: BinomialExtensionData<WIDTH> + FieldParameters,
impl<const WIDTH: usize, FP> BinomiallyExtendable<WIDTH> for MontyField31<FP>where
FP: BinomialExtensionData<WIDTH> + FieldParameters,
Source§const EXT_GENERATOR: [Self; WIDTH] = FP::EXT_GENERATOR
const EXT_GENERATOR: [Self; WIDTH] = FP::EXT_GENERATOR
D polynomial. Read moreSource§impl<const WIDTH: usize, FP> BinomiallyExtendableAlgebra<MontyField31<FP>, WIDTH> for MontyField31<FP>where
FP: BinomialExtensionData<WIDTH> + FieldParameters,
impl<const WIDTH: usize, FP> BinomiallyExtendableAlgebra<MontyField31<FP>, WIDTH> for MontyField31<FP>where
FP: BinomialExtensionData<WIDTH> + FieldParameters,
Source§fn binomial_mul(
a: &[Self; WIDTH],
b: &[Self; WIDTH],
res: &mut [Self; WIDTH],
_w: Self,
)
fn binomial_mul( a: &[Self; WIDTH], b: &[Self; WIDTH], res: &mut [Self; WIDTH], _w: Self, )
A<X> / (X^D - W). Read moreSource§fn binomial_add(a: &[Self; WIDTH], b: &[Self; WIDTH]) -> [Self; WIDTH]
fn binomial_add(a: &[Self; WIDTH], b: &[Self; WIDTH]) -> [Self; WIDTH]
A<X> / (X^D - W). Read moreSource§fn binomial_sub(a: &[Self; WIDTH], b: &[Self; WIDTH]) -> [Self; WIDTH]
fn binomial_sub(a: &[Self; WIDTH], b: &[Self; WIDTH]) -> [Self; WIDTH]
A<X> / (X^D - W). Read morefn binomial_base_mul(lhs: [Self; WIDTH], rhs: Self) -> [Self; WIDTH]
Source§impl<MP: Clone + MontyParameters> Clone for MontyField31<MP>
impl<MP: Clone + MontyParameters> Clone for MontyField31<MP>
Source§fn clone(&self) -> MontyField31<MP>
fn clone(&self) -> MontyField31<MP>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<FP: MontyParameters> Debug for MontyField31<FP>
impl<FP: MontyParameters> Debug for MontyField31<FP>
Source§impl<MP: Default + MontyParameters> Default for MontyField31<MP>
impl<MP: Default + MontyParameters> Default for MontyField31<MP>
Source§fn default() -> MontyField31<MP>
fn default() -> MontyField31<MP>
Source§impl<'de, FP: FieldParameters> Deserialize<'de> for MontyField31<FP>
impl<'de, FP: FieldParameters> Deserialize<'de> for MontyField31<FP>
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Source§impl<FP: MontyParameters> Display for MontyField31<FP>
impl<FP: MontyParameters> Display for MontyField31<FP>
Source§impl<FP: MontyParameters> Distribution<MontyField31<FP>> for StandardUniform
impl<FP: MontyParameters> Distribution<MontyField31<FP>> for StandardUniform
Source§fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> MontyField31<FP>
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> MontyField31<FP>
T, using rng as the source of randomness.Source§fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T>
fn sample_iter<R>(self, rng: R) -> Iter<Self, R, T>
T, using rng as
the source of randomness. Read moreSource§impl<FP: FieldParameters> Div for MontyField31<FP>
impl<FP: FieldParameters> Div for MontyField31<FP>
Source§type Output = MontyField31<FP>
type Output = MontyField31<FP>
/ operator.Source§fn div(self, rhs: MontyField31<FP>) -> Self
fn div(self, rhs: MontyField31<FP>) -> Self
/ operation. Read moreSource§impl<FP: FieldParameters> DivAssign for MontyField31<FP>
impl<FP: FieldParameters> DivAssign for MontyField31<FP>
Source§fn div_assign(&mut self, rhs: MontyField31<FP>)
fn div_assign(&mut self, rhs: MontyField31<FP>)
/= operation. Read moreSource§impl<FP, const WIDTH: usize, const D: u64> ExternalLayer<MontyField31<FP>, WIDTH, D> for Poseidon2ExternalLayerMonty31<FP, WIDTH>where
FP: FieldParameters + RelativelyPrimePower<D>,
impl<FP, const WIDTH: usize, const D: u64> ExternalLayer<MontyField31<FP>, WIDTH, D> for Poseidon2ExternalLayerMonty31<FP, WIDTH>where
FP: FieldParameters + RelativelyPrimePower<D>,
Source§fn permute_state_initial(&self, state: &mut [MontyField31<FP>; WIDTH])
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])
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, const WIDTH: usize> ExternalLayerConstructor<MontyField31<FP>, WIDTH> for Poseidon2ExternalLayerMonty31<FP, WIDTH>
impl<FP: FieldParameters, const WIDTH: usize> ExternalLayerConstructor<MontyField31<FP>, WIDTH> for Poseidon2ExternalLayerMonty31<FP, WIDTH>
Source§fn new_from_constants(
external_constants: ExternalLayerConstants<MontyField31<FP>, WIDTH>,
) -> Self
fn new_from_constants( external_constants: ExternalLayerConstants<MontyField31<FP>, WIDTH>, ) -> Self
Source§impl<FP: FieldParameters> Field for MontyField31<FP>
impl<FP: FieldParameters> Field for MontyField31<FP>
type Packing = MontyField31<FP>
Source§fn try_inverse(&self) -> Option<Self>
fn try_inverse(&self) -> Option<Self>
Source§fn is_zero(&self) -> bool
fn is_zero(&self) -> bool
Source§fn is_one(&self) -> bool
fn is_one(&self) -> bool
Source§fn add_slices(slice_1: &mut [Self], slice_2: &[Self])
fn add_slices(slice_1: &mut [Self], slice_2: &[Self])
Source§impl<const WIDTH: usize, FP> HasTwoAdicBinomialExtension<WIDTH> for MontyField31<FP>
impl<const WIDTH: usize, FP> HasTwoAdicBinomialExtension<WIDTH> for MontyField31<FP>
Source§impl<MP: Hash + MontyParameters> Hash for MontyField31<MP>
impl<MP: Hash + MontyParameters> Hash for MontyField31<MP>
Source§impl<FP: FieldParameters + RelativelyPrimePower<D>, const D: u64> InjectiveMonomial<D> for MontyField31<FP>
impl<FP: FieldParameters + RelativelyPrimePower<D>, const D: u64> InjectiveMonomial<D> for MontyField31<FP>
Source§fn injective_exp_n(&self) -> Self
fn injective_exp_n(&self) -> Self
x -> x^n for a given n > 1 such that this
map is injective.Source§impl<FP, const WIDTH: usize, P2P, const D: u64> InternalLayer<MontyField31<FP>, WIDTH, D> for Poseidon2InternalLayerMonty31<FP, WIDTH, P2P>
impl<FP, const WIDTH: usize, P2P, const D: u64> InternalLayer<MontyField31<FP>, WIDTH, D> for Poseidon2InternalLayerMonty31<FP, WIDTH, P2P>
Source§fn permute_state(&self, state: &mut [MontyField31<FP>; WIDTH])
fn permute_state(&self, state: &mut [MontyField31<FP>; WIDTH])
Perform the internal layers of the Poseidon2 permutation on the given state.
Source§impl<FP: FieldParameters, const WIDTH: usize, ILP: InternalLayerBaseParameters<FP, WIDTH>> InternalLayerConstructor<MontyField31<FP>> for Poseidon2InternalLayerMonty31<FP, WIDTH, ILP>
impl<FP: FieldParameters, const WIDTH: usize, ILP: InternalLayerBaseParameters<FP, WIDTH>> InternalLayerConstructor<MontyField31<FP>> for Poseidon2InternalLayerMonty31<FP, WIDTH, ILP>
Source§fn new_from_constants(internal_constants: Vec<MontyField31<FP>>) -> Self
fn new_from_constants(internal_constants: Vec<MontyField31<FP>>) -> Self
Source§impl<FP: MontyParameters> Mul for MontyField31<FP>
impl<FP: MontyParameters> Mul for MontyField31<FP>
Source§impl<FP: FieldParameters, T: Into<Self>> MulAssign<T> for MontyField31<FP>
impl<FP: FieldParameters, T: Into<Self>> MulAssign<T> for MontyField31<FP>
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
*= operation. Read moreSource§impl<FP: FieldParameters> Neg for MontyField31<FP>
impl<FP: FieldParameters> Neg for MontyField31<FP>
Source§impl<FP: MontyParameters> Ord for MontyField31<FP>
impl<FP: MontyParameters> Ord for MontyField31<FP>
Source§impl<MP: PartialEq + MontyParameters> PartialEq for MontyField31<MP>
impl<MP: PartialEq + MontyParameters> PartialEq for MontyField31<MP>
Source§impl<FP: MontyParameters> PartialOrd for MontyField31<FP>
impl<FP: MontyParameters> PartialOrd for MontyField31<FP>
Source§impl<FP: FieldParameters + RelativelyPrimePower<D>, const D: u64> PermutationMonomial<D> for MontyField31<FP>
impl<FP: FieldParameters + RelativelyPrimePower<D>, const D: u64> PermutationMonomial<D> for MontyField31<FP>
Source§fn injective_exp_root_n(&self) -> Self
fn injective_exp_root_n(&self) -> Self
x -> x^K for a given K > 1 such that
x^{NK} = x for all elements x.Source§impl<FP: FieldParameters> PrimeCharacteristicRing for MontyField31<FP>
impl<FP: FieldParameters> PrimeCharacteristicRing for MontyField31<FP>
Source§type PrimeSubfield = MontyField31<FP>
type PrimeSubfield = MontyField31<FP>
ℤ/p where the characteristic of this ring is p.Source§fn from_prime_subfield(f: Self) -> Self
fn from_prime_subfield(f: Self) -> Self
Source§fn mul_2exp_u64(&self, exp: u64) -> Self
fn mul_2exp_u64(&self, exp: u64) -> Self
mul_2exp_u64(a, exp) = a * 2^{exp}. Read moreSource§fn div_2exp_u64(&self, exp: u64) -> Self
fn div_2exp_u64(&self, exp: u64) -> Self
div_2exp_u64(a, exp) = a/2^exp Read moreSource§fn zero_vec(len: usize) -> Vec<Self>
fn zero_vec(len: usize) -> Vec<Self>
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 moreSource§fn sum_array<const N: usize>(input: &[Self]) -> Self
fn sum_array<const N: usize>(input: &[Self]) -> Self
Source§fn dot_product<const N: usize>(lhs: &[Self; N], rhs: &[Self; N]) -> Self
fn dot_product<const N: usize>(lhs: &[Self; N], rhs: &[Self; N]) -> Self
Source§fn from_usize(int: usize) -> Self
fn from_usize(int: usize) -> Self
Source§fn from_isize(int: isize) -> Self
fn from_isize(int: isize) -> Self
Source§fn xor(&self, y: &Self) -> Self
fn xor(&self, y: &Self) -> Self
xor. Read moreSource§fn xor3(&self, y: &Self, z: &Self) -> Self
fn xor3(&self, y: &Self, z: &Self) -> Self
xor. Read moreSource§fn bool_check(&self) -> Self
fn bool_check(&self) -> Self
x * (1 - x). Read moreSource§fn exp_const_u64<const POWER: u64>(&self) -> Self
fn exp_const_u64<const POWER: u64>(&self) -> Self
Source§fn exp_power_of_2(&self, power_log: usize) -> Self
fn exp_power_of_2(&self, power_log: usize) -> Self
exp_power_of_2(a, power_log) = a^{2^power_log}. Read moreSource§fn powers(&self) -> Powers<Self>
fn powers(&self) -> Powers<Self>
self: self^0, self^1, self^2, ....Source§fn shifted_powers(&self, start: Self) -> Powers<Self>
fn shifted_powers(&self, start: Self) -> Powers<Self>
self shifted by start: start, start*self^1, start*self^2, ....Source§impl<FP: FieldParameters> PrimeField for MontyField31<FP>
impl<FP: FieldParameters> PrimeField for MontyField31<FP>
Source§fn as_canonical_biguint(&self) -> BigUint
fn as_canonical_biguint(&self) -> BigUint
value in canonical form
which lies in the range 0 <= x < self.order().Source§impl<FP: FieldParameters> PrimeField32 for MontyField31<FP>
impl<FP: FieldParameters> PrimeField32 for MontyField31<FP>
const ORDER_U32: u32 = FP::PRIME
Source§fn as_canonical_u32(&self) -> u32
fn as_canonical_u32(&self) -> u32
value in canonical form
which lies in the range 0 <= x < ORDER_U64.Source§fn to_unique_u32(&self) -> u32
fn to_unique_u32(&self) -> u32
u32 such that any two field elements
are converted to the same u32 if and only if they represent the same value. Read moreSource§impl<FP: FieldParameters> PrimeField64 for MontyField31<FP>
impl<FP: FieldParameters> PrimeField64 for MontyField31<FP>
const ORDER_U64: u64
Source§fn as_canonical_u64(&self) -> u64
fn as_canonical_u64(&self) -> u64
value in canonical form
which lies in the range 0 <= x < ORDER_U64.Source§fn to_unique_u64(&self) -> u64
fn to_unique_u64(&self) -> u64
u64 such that any two field elements
are converted to the same u64 if and only if they represent the same value. Read moreSource§impl<FP: FieldParameters> Product for MontyField31<FP>
impl<FP: FieldParameters> Product for MontyField31<FP>
Source§impl<FP: FieldParameters> QuotientMap<i128> for MontyField31<FP>
impl<FP: FieldParameters> QuotientMap<i128> for MontyField31<FP>
Source§fn from_int(int: i128) -> Self
fn from_int(int: i128) -> Self
Convert a given i128 integer into an element of the MontyField31 field.
Source§fn from_canonical_checked(int: i128) -> Option<Self>
fn from_canonical_checked(int: i128) -> Option<Self>
Convert a given i128 integer into an element of the MontyField31 field.
Returns None if the given integer does not lie in the range [(1 - P)/2, (P - 1)/2].
Source§unsafe fn from_canonical_unchecked(int: i128) -> Self
unsafe fn from_canonical_unchecked(int: i128) -> Self
Convert a given i128 integer into an element of the MontyField31 field.
§Safety
The input must be a valid i64 element.
Source§impl<FP: FieldParameters> QuotientMap<i16> for MontyField31<FP>
impl<FP: FieldParameters> QuotientMap<i16> for MontyField31<FP>
Source§fn from_int(int: i16) -> Self
fn from_int(int: i16) -> Self
Convert a given i16 integer into an element of the MontyField31 field.
Due to the integer type, the input value is always canonical.
Source§fn from_canonical_checked(int: i16) -> Option<Self>
fn from_canonical_checked(int: i16) -> Option<Self>
Convert a given i16 integer into an element of the MontyField31 field.
Due to the integer type, the input value is always canonical.
Source§unsafe fn from_canonical_unchecked(int: i16) -> Self
unsafe fn from_canonical_unchecked(int: i16) -> Self
Convert a given i16 integer into an element of the MontyField31 field.
Due to the integer type, the input value is always canonical.
Source§impl<FP: FieldParameters> QuotientMap<i32> for MontyField31<FP>
impl<FP: FieldParameters> QuotientMap<i32> for MontyField31<FP>
Source§fn from_int(int: i32) -> Self
fn from_int(int: i32) -> Self
Convert a given i32 integer into an element of the MontyField31 field.
Source§fn from_canonical_checked(int: i32) -> Option<Self>
fn from_canonical_checked(int: i32) -> Option<Self>
Convert a given i32 integer into an element of the MontyField31 field.
Returns None if the given integer does not lie in the range [(1 - P)/2, (P - 1)/2].
Source§unsafe fn from_canonical_unchecked(int: i32) -> Self
unsafe fn from_canonical_unchecked(int: i32) -> Self
Convert a given i32 integer into an element of the MontyField31 field.
§Safety
This is always safe as the conversion to monty form can accept any i32.
Source§impl<FP: FieldParameters> QuotientMap<i64> for MontyField31<FP>
impl<FP: FieldParameters> QuotientMap<i64> for MontyField31<FP>
Source§fn from_int(int: i64) -> Self
fn from_int(int: i64) -> Self
Convert a given i64 integer into an element of the MontyField31 field.
Source§fn from_canonical_checked(int: i64) -> Option<Self>
fn from_canonical_checked(int: i64) -> Option<Self>
Convert a given i64 integer into an element of the MontyField31 field.
Returns None if the given integer does not lie in the range [(1 - P)/2, (P - 1)/2].
Source§unsafe fn from_canonical_unchecked(int: i64) -> Self
unsafe fn from_canonical_unchecked(int: i64) -> Self
Convert a given i64 integer into an element of the MontyField31 field.
§Safety
This is always safe as the conversion to monty form can accept any i64.
Source§impl<FP: FieldParameters> QuotientMap<i8> for MontyField31<FP>
impl<FP: FieldParameters> QuotientMap<i8> for MontyField31<FP>
Source§fn from_int(int: i8) -> Self
fn from_int(int: i8) -> Self
Convert a given i8 integer into an element of the MontyField31 field.
Due to the integer type, the input value is always canonical.
Source§fn from_canonical_checked(int: i8) -> Option<Self>
fn from_canonical_checked(int: i8) -> Option<Self>
Convert a given i8 integer into an element of the MontyField31 field.
Due to the integer type, the input value is always canonical.
Source§unsafe fn from_canonical_unchecked(int: i8) -> Self
unsafe fn from_canonical_unchecked(int: i8) -> Self
Convert a given i8 integer into an element of the MontyField31 field.
Due to the integer type, the input value is always canonical.
Source§impl<FP: FieldParameters> QuotientMap<u128> for MontyField31<FP>
impl<FP: FieldParameters> QuotientMap<u128> for MontyField31<FP>
Source§fn from_int(int: u128) -> Self
fn from_int(int: u128) -> Self
Convert a given u128 integer into an element of the MontyField31 field.
Source§fn from_canonical_checked(int: u128) -> Option<Self>
fn from_canonical_checked(int: u128) -> Option<Self>
Convert a given u128 integer into an element of the MontyField31 field.
Returns None if the given integer is greater than the Prime.
Source§unsafe fn from_canonical_unchecked(int: u128) -> Self
unsafe fn from_canonical_unchecked(int: u128) -> Self
Convert a given u128 integer into an element of the MontyField31 field.
§Safety
The input must be a valid u64 element.
Source§impl<FP: FieldParameters> QuotientMap<u16> for MontyField31<FP>
impl<FP: FieldParameters> QuotientMap<u16> for MontyField31<FP>
Source§fn from_int(int: u16) -> Self
fn from_int(int: u16) -> Self
Convert a given u16 integer into an element of the MontyField31 field.
Due to the integer type, the input value is always canonical.
Source§fn from_canonical_checked(int: u16) -> Option<Self>
fn from_canonical_checked(int: u16) -> Option<Self>
Convert a given u16 integer into an element of the MontyField31 field.
Due to the integer type, the input value is always canonical.
Source§unsafe fn from_canonical_unchecked(int: u16) -> Self
unsafe fn from_canonical_unchecked(int: u16) -> Self
Convert a given u16 integer into an element of the MontyField31 field.
Due to the integer type, the input value is always canonical.
Source§impl<FP: FieldParameters> QuotientMap<u32> for MontyField31<FP>
impl<FP: FieldParameters> QuotientMap<u32> for MontyField31<FP>
Source§fn from_int(int: u32) -> Self
fn from_int(int: u32) -> Self
Convert a given u32 integer into an element of the MontyField31 field.
Source§fn from_canonical_checked(int: u32) -> Option<Self>
fn from_canonical_checked(int: u32) -> Option<Self>
Convert a given u32 integer into an element of the MontyField31 field.
Returns None if the given integer is greater than the Prime.
Source§unsafe fn from_canonical_unchecked(int: u32) -> Self
unsafe fn from_canonical_unchecked(int: u32) -> Self
Convert a given u32 integer into an element of the MontyField31 field.
§Safety
This is always safe as the conversion to monty form can accept any u32.
Source§impl<FP: FieldParameters> QuotientMap<u64> for MontyField31<FP>
impl<FP: FieldParameters> QuotientMap<u64> for MontyField31<FP>
Source§fn from_int(int: u64) -> Self
fn from_int(int: u64) -> Self
Convert a given u64 integer into an element of the MontyField31 field.
Source§fn from_canonical_checked(int: u64) -> Option<Self>
fn from_canonical_checked(int: u64) -> Option<Self>
Convert a given u64 integer into an element of the MontyField31 field.
Returns None if the given integer is greater than the Prime.
Source§unsafe fn from_canonical_unchecked(int: u64) -> Self
unsafe fn from_canonical_unchecked(int: u64) -> Self
Convert a given u64 integer into an element of the MontyField31 field.
§Safety
This is always safe as the conversion to monty form can accept any u64.
Source§impl<FP: FieldParameters> QuotientMap<u8> for MontyField31<FP>
impl<FP: FieldParameters> QuotientMap<u8> for MontyField31<FP>
Source§fn from_int(int: u8) -> Self
fn from_int(int: u8) -> Self
Convert a given u8 integer into an element of the MontyField31 field.
Due to the integer type, the input value is always canonical.
Source§fn from_canonical_checked(int: u8) -> Option<Self>
fn from_canonical_checked(int: u8) -> Option<Self>
Convert a given u8 integer into an element of the MontyField31 field.
Due to the integer type, the input value is always canonical.
Source§unsafe fn from_canonical_unchecked(int: u8) -> Self
unsafe fn from_canonical_unchecked(int: u8) -> Self
Convert a given u8 integer into an element of the MontyField31 field.
Due to the integer type, the input value is always canonical.
Source§impl<FP: FieldParameters> RawDataSerializable for MontyField31<FP>
impl<FP: FieldParameters> RawDataSerializable for MontyField31<FP>
Source§const NUM_BYTES: usize = 4usize
const NUM_BYTES: usize = 4usize
Source§fn into_bytes(self) -> [u8; 4]
fn into_bytes(self) -> [u8; 4]
Source§fn into_u32_stream(
input: impl IntoIterator<Item = Self>,
) -> impl IntoIterator<Item = u32>
fn into_u32_stream( input: impl IntoIterator<Item = Self>, ) -> impl IntoIterator<Item = u32>
Source§fn into_u64_stream(
input: impl IntoIterator<Item = Self>,
) -> impl IntoIterator<Item = u64>
fn into_u64_stream( input: impl IntoIterator<Item = Self>, ) -> impl IntoIterator<Item = u64>
Source§fn into_parallel_byte_streams<const N: usize>(
input: impl IntoIterator<Item = [Self; N]>,
) -> impl IntoIterator<Item = [u8; N]>
fn into_parallel_byte_streams<const N: usize>( input: impl IntoIterator<Item = [Self; N]>, ) -> impl IntoIterator<Item = [u8; N]>
Source§fn into_parallel_u32_streams<const N: usize>(
input: impl IntoIterator<Item = [Self; N]>,
) -> impl IntoIterator<Item = [u32; N]>
fn into_parallel_u32_streams<const N: usize>( input: impl IntoIterator<Item = [Self; N]>, ) -> impl IntoIterator<Item = [u32; N]>
Source§fn into_parallel_u64_streams<const N: usize>(
input: impl IntoIterator<Item = [Self; N]>,
) -> impl IntoIterator<Item = [u64; N]>
fn into_parallel_u64_streams<const N: usize>( input: impl IntoIterator<Item = [Self; N]>, ) -> impl IntoIterator<Item = [u64; N]>
Source§fn into_byte_stream(
input: impl IntoIterator<Item = Self>,
) -> impl IntoIterator<Item = u8>
fn into_byte_stream( input: impl IntoIterator<Item = Self>, ) -> impl IntoIterator<Item = u8>
Source§impl<FP: FieldParameters> Serialize for MontyField31<FP>
impl<FP: FieldParameters> Serialize for MontyField31<FP>
Source§impl<FP: MontyParameters> Sub for MontyField31<FP>
impl<FP: MontyParameters> Sub for MontyField31<FP>
Source§impl<MP: MontyParameters, T: Into<Self>> SubAssign<T> for MontyField31<MP>
impl<MP: MontyParameters, T: Into<Self>> SubAssign<T> for MontyField31<MP>
Source§fn sub_assign(&mut self, rhs: T)
fn sub_assign(&mut self, rhs: T)
-= operation. Read moreSource§impl<FP: MontyParameters> Sum for MontyField31<FP>
impl<FP: MontyParameters> Sum for MontyField31<FP>
Source§impl<FP: FieldParameters + TwoAdicData> TwoAdicField for MontyField31<FP>
impl<FP: FieldParameters + TwoAdicData> TwoAdicField for MontyField31<FP>
Source§const TWO_ADICITY: usize = FP::TWO_ADICITY
const TWO_ADICITY: usize = FP::TWO_ADICITY
Source§fn two_adic_generator(bits: usize) -> Self
fn two_adic_generator(bits: usize) -> Self
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.
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 transposes 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>>>
type Evaluations = RowIndexMappedView<BitReversalPerm, DenseMatrix<MontyField31<MP>>>
Source§fn dft_batch(&self, mat: RowMajorMatrix<MontyField31<MP>>) -> Self::Evaluations
fn dft_batch(&self, mat: RowMajorMatrix<MontyField31<MP>>) -> Self::Evaluations
mat.
This is the only method an implementer needs to define, all other
methods can be derived from this one. Read moreSource§fn idft_batch(
&self,
mat: RowMajorMatrix<MontyField31<MP>>,
) -> RowMajorMatrix<MontyField31<MP>>
fn idft_batch( &self, mat: RowMajorMatrix<MontyField31<MP>>, ) -> RowMajorMatrix<MontyField31<MP>>
mat. Read moreSource§fn coset_lde_batch(
&self,
mat: RowMajorMatrix<MontyField31<MP>>,
added_bits: usize,
shift: MontyField31<MP>,
) -> Self::Evaluations
fn coset_lde_batch( &self, mat: RowMajorMatrix<MontyField31<MP>>, added_bits: usize, shift: MontyField31<MP>, ) -> Self::Evaluations
mat onto a coset of a larger subgroup. Read moreSource§fn dft(&self, vec: Vec<F>) -> Vec<F>
fn dft(&self, vec: Vec<F>) -> Vec<F>
vec. Read moreSource§fn coset_dft(&self, vec: Vec<F>, shift: F) -> Vec<F>
fn coset_dft(&self, vec: Vec<F>, shift: F) -> Vec<F>
vec. Read moreSource§fn coset_dft_batch(&self, mat: DenseMatrix<F>, shift: F) -> Self::Evaluations
fn coset_dft_batch(&self, mat: DenseMatrix<F>, shift: F) -> Self::Evaluations
mat. Read moreSource§fn coset_idft(&self, vec: Vec<F>, shift: F) -> Vec<F>
fn coset_idft(&self, vec: Vec<F>, shift: F) -> Vec<F>
vec. This is the inverse operation of “coset DFT”. Read moreSource§fn coset_idft_batch(&self, mat: DenseMatrix<F>, shift: F) -> DenseMatrix<F>
fn coset_idft_batch(&self, mat: DenseMatrix<F>, shift: F) -> DenseMatrix<F>
mat. This is the inverse operation
of “coset DFT”. Read moreSource§fn lde(&self, vec: Vec<F>, added_bits: usize) -> Vec<F>
fn lde(&self, vec: Vec<F>, added_bits: usize) -> Vec<F>
vec onto a larger subgroup. Read moreSource§fn lde_batch(&self, mat: DenseMatrix<F>, added_bits: usize) -> Self::Evaluations
fn lde_batch(&self, mat: DenseMatrix<F>, added_bits: usize) -> Self::Evaluations
mat onto a larger subgroup. Read moreSource§fn coset_lde(&self, vec: Vec<F>, added_bits: usize, shift: F) -> Vec<F>
fn coset_lde(&self, vec: Vec<F>, added_bits: usize, shift: F) -> Vec<F>
vec onto a coset of a larger subgroup. Read moreSource§fn dft_algebra<V>(&self, vec: Vec<V>) -> Vec<V>
fn dft_algebra<V>(&self, vec: Vec<V>) -> Vec<V>
vec. Read moreSource§fn dft_algebra_batch<V>(&self, mat: DenseMatrix<V>) -> DenseMatrix<V>
fn dft_algebra_batch<V>(&self, mat: DenseMatrix<V>) -> DenseMatrix<V>
mat. Read moreSource§fn coset_dft_algebra<V>(&self, vec: Vec<V>, shift: F) -> Vec<V>
fn coset_dft_algebra<V>(&self, vec: Vec<V>, shift: F) -> Vec<V>
vec. Read moreSource§fn coset_dft_algebra_batch<V>(
&self,
mat: DenseMatrix<V>,
shift: F,
) -> DenseMatrix<V>
fn coset_dft_algebra_batch<V>( &self, mat: DenseMatrix<V>, shift: F, ) -> DenseMatrix<V>
mat. Read moreSource§fn idft_algebra_batch<V>(&self, mat: DenseMatrix<V>) -> DenseMatrix<V>
fn idft_algebra_batch<V>(&self, mat: DenseMatrix<V>) -> DenseMatrix<V>
mat. Read moreSource§fn coset_idft_algebra<V>(&self, vec: Vec<V>, shift: F) -> Vec<V>
fn coset_idft_algebra<V>(&self, vec: Vec<V>, shift: F) -> Vec<V>
vec. This is the inverse operation of “coset DFT”. Read moreSource§fn coset_idft_algebra_batch<V>(
&self,
mat: DenseMatrix<V>,
shift: F,
) -> DenseMatrix<V>
fn coset_idft_algebra_batch<V>( &self, mat: DenseMatrix<V>, shift: F, ) -> DenseMatrix<V>
mat. This is the inverse operation
of “coset DFT”. Read moreSource§fn lde_algebra<V>(&self, vec: Vec<V>, added_bits: usize) -> Vec<V>
fn lde_algebra<V>(&self, vec: Vec<V>, added_bits: usize) -> Vec<V>
vec onto a larger subgroup. Read moreSource§fn lde_algebra_batch<V>(
&self,
mat: DenseMatrix<V>,
added_bits: usize,
) -> DenseMatrix<V>
fn lde_algebra_batch<V>( &self, mat: DenseMatrix<V>, added_bits: usize, ) -> DenseMatrix<V>
mat onto a larger subgroup. Read moreSource§fn coset_lde_algebra<V>(
&self,
vec: Vec<V>,
added_bits: usize,
shift: F,
) -> Vec<V>
fn coset_lde_algebra<V>( &self, vec: Vec<V>, added_bits: usize, shift: F, ) -> Vec<V>
vec onto a coset of a larger subgroup. Read moreSource§fn coset_lde_algebra_batch<V>(
&self,
mat: DenseMatrix<V>,
added_bits: usize,
shift: F,
) -> DenseMatrix<V>
fn coset_lde_algebra_batch<V>( &self, mat: DenseMatrix<V>, added_bits: usize, shift: F, ) -> DenseMatrix<V>
mat onto a coset of a larger subgroup. Read moreimpl<MP: Copy + MontyParameters> Copy for MontyField31<MP>
impl<MP: Eq + MontyParameters> Eq for MontyField31<MP>
impl<FP: MontyParameters, MU: MDSUtils> MdsPermutation<MontyField31<FP>, 12> for MdsMatrixMontyField31<MU>
impl<FP: MontyParameters, MU: MDSUtils> MdsPermutation<MontyField31<FP>, 16> for MdsMatrixMontyField31<MU>
impl<FP: BarrettParameters, MU: MDSUtils> MdsPermutation<MontyField31<FP>, 24> for MdsMatrixMontyField31<MU>
impl<FP: BarrettParameters, MU: MDSUtils> MdsPermutation<MontyField31<FP>, 32> for MdsMatrixMontyField31<MU>
impl<FP: BarrettParameters, MU: MDSUtils> MdsPermutation<MontyField31<FP>, 64> for MdsMatrixMontyField31<MU>
impl<FP: MontyParameters, MU: MDSUtils> MdsPermutation<MontyField31<FP>, 8> for MdsMatrixMontyField31<MU>
impl<MP: MontyParameters> Packable for MontyField31<MP>
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<F> BasedVectorSpace<F> for Fwhere
F: PrimeCharacteristicRing,
impl<F> BasedVectorSpace<F> for Fwhere
F: PrimeCharacteristicRing,
Source§const DIMENSION: usize = 1usize
const DIMENSION: usize = 1usize
Source§fn as_basis_coefficients_slice(&self) -> &[F]
fn as_basis_coefficients_slice(&self) -> &[F]
A and uses this to
map an element of A to a slice of DIMENSION F elements. Read moreSource§fn from_basis_coefficients_fn<Fn>(f: Fn) -> F
fn from_basis_coefficients_fn<Fn>(f: Fn) -> F
A and uses this to
map DIMENSION F elements to an element of A. Similar
to core:array::from_fn, the DIMENSION F elements are
given by Fn(0), ..., Fn(DIMENSION - 1) called in that order. Read moreSource§fn from_basis_coefficients_iter<I>(iter: I) -> Option<F>where
I: ExactSizeIterator<Item = F>,
fn from_basis_coefficients_iter<I>(iter: I) -> Option<F>where
I: ExactSizeIterator<Item = F>,
A and uses this to
map DIMENSION F elements to an element of A. Read moreSource§fn flatten_to_base(vec: Vec<F>) -> Vec<F>
fn flatten_to_base(vec: Vec<F>) -> Vec<F>
Source§fn reconstitute_from_base(vec: Vec<F>) -> Vec<F>
fn reconstitute_from_base(vec: Vec<F>) -> Vec<F>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F> ExtensionField<F> for Fwhere
F: Field,
impl<F> ExtensionField<F> for Fwhere
F: Field,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<F> PackedField for Fwhere
F: Field,
impl<F> PackedField for Fwhere
F: Field,
type Scalar = F
Source§fn packed_powers(base: Self::Scalar) -> Powers<Self>
fn packed_powers(base: Self::Scalar) -> Powers<Self>
base packed into packed field elements. Read moreSource§impl<F> PackedFieldPow2 for Fwhere
F: Field,
impl<F> PackedFieldPow2 for Fwhere
F: Field,
Source§impl<T> PackedValue for Twhere
T: Packable,
impl<T> PackedValue for Twhere
T: Packable,
Source§fn from_slice(slice: &[<T as PackedValue>::Value]) -> &T
fn from_slice(slice: &[<T as PackedValue>::Value]) -> &T
Source§fn from_slice_mut(slice: &mut [<T as PackedValue>::Value]) -> &mut T
fn from_slice_mut(slice: &mut [<T as PackedValue>::Value]) -> &mut T
Source§fn from_fn<Fn>(f: Fn) -> T
fn from_fn<Fn>(f: Fn) -> T
Source§fn as_slice(&self) -> &[<T as PackedValue>::Value]
fn as_slice(&self) -> &[<T as PackedValue>::Value]
Source§fn as_slice_mut(&mut self) -> &mut [<T as PackedValue>::Value]
fn as_slice_mut(&mut self) -> &mut [<T as PackedValue>::Value]
Source§fn pack_slice(buf: &[Self::Value]) -> &[Self]
fn pack_slice(buf: &[Self::Value]) -> &[Self]
Source§fn pack_slice_with_suffix(buf: &[Self::Value]) -> (&[Self], &[Self::Value])
fn pack_slice_with_suffix(buf: &[Self::Value]) -> (&[Self], &[Self::Value])
Source§fn pack_slice_mut(buf: &mut [Self::Value]) -> &mut [Self]
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>]
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])
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>])
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]
fn unpack_slice(buf: &[Self]) -> &[Self::Value]
Source§impl<F> QuotientMap<isize> for Fwhere
F: QuotientMap<i8> + QuotientMap<i16> + QuotientMap<i32> + QuotientMap<i64> + QuotientMap<i128>,
impl<F> QuotientMap<isize> for Fwhere
F: QuotientMap<i8> + QuotientMap<i16> + QuotientMap<i32> + QuotientMap<i64> + QuotientMap<i128>,
Source§fn from_int(int: isize) -> F
fn from_int(int: isize) -> F
We use the from_int method of the primitive integer type identical to isize on this machine
Source§fn from_canonical_checked(int: isize) -> Option<F>
fn from_canonical_checked(int: isize) -> Option<F>
We use the from_canonical_checked method of the primitive integer type identical to isize on this machine
Source§unsafe fn from_canonical_unchecked(int: isize) -> F
unsafe fn from_canonical_unchecked(int: isize) -> F
We use the from_canonical_unchecked method of the primitive integer type identical to isize on this machine
Source§impl<F> QuotientMap<usize> for Fwhere
F: QuotientMap<u8> + QuotientMap<u16> + QuotientMap<u32> + QuotientMap<u64> + QuotientMap<u128>,
impl<F> QuotientMap<usize> for Fwhere
F: QuotientMap<u8> + QuotientMap<u16> + QuotientMap<u32> + QuotientMap<u64> + QuotientMap<u128>,
Source§fn from_int(int: usize) -> F
fn from_int(int: usize) -> F
We use the from_int method of the primitive integer type identical to usize on this machine
Source§fn from_canonical_checked(int: usize) -> Option<F>
fn from_canonical_checked(int: usize) -> Option<F>
We use the from_canonical_checked method of the primitive integer type identical to usize on this machine
Source§unsafe fn from_canonical_unchecked(int: usize) -> F
unsafe fn from_canonical_unchecked(int: usize) -> F
We use the from_canonical_unchecked method of the primitive integer type identical to usize on this machine