pub struct CubicExtField<P>where
P: CubicExtConfig,{
pub c0: <P as CubicExtConfig>::BaseField,
pub c1: <P as CubicExtConfig>::BaseField,
pub c2: <P as CubicExtConfig>::BaseField,
}
Expand description
An element of a cubic extension field F_p[X]/(X^3 - P::NONRESIDUE) is
represented as c0 + c1 * X + c2 * X^2, for c0, c1, c2 in P::BaseField
.
Fields§
§c0: <P as CubicExtConfig>::BaseField
§c1: <P as CubicExtConfig>::BaseField
§c2: <P as CubicExtConfig>::BaseField
Implementations§
Source§impl<P> CubicExtField<Fp3ConfigWrapper<P>>where
P: Fp3Config,
impl<P> CubicExtField<Fp3ConfigWrapper<P>>where
P: Fp3Config,
Sourcepub fn mul_assign_by_fp(&mut self, value: &<P as Fp3Config>::Fp)
pub fn mul_assign_by_fp(&mut self, value: &<P as Fp3Config>::Fp)
In-place multiply all coefficients c0
, c1
, and c2
of self
by an element from Fp
.
§Examples
use ark_mnt6_753::{Fq as Fp, Fq3 as Fp3};
let c0: Fp = Fp::rand(&mut test_rng());
let c1: Fp = Fp::rand(&mut test_rng());
let c2: Fp = Fp::rand(&mut test_rng());
let mut ext_element: Fp3 = Fp3::new(c0, c1, c2);
let base_field_element: Fp = Fp::rand(&mut test_rng());
ext_element.mul_assign_by_fp(&base_field_element);
assert_eq!(ext_element.c0, c0 * base_field_element);
assert_eq!(ext_element.c1, c1 * base_field_element);
assert_eq!(ext_element.c2, c2 * base_field_element);
Source§impl<P> CubicExtField<Fp6ConfigWrapper<P>>where
P: Fp6Config,
impl<P> CubicExtField<Fp6ConfigWrapper<P>>where
P: Fp6Config,
pub fn mul_assign_by_fp2( &mut self, other: QuadExtField<Fp2ConfigWrapper<<P as Fp6Config>::Fp2Config>>, )
pub fn mul_by_fp( &mut self, element: &<<P as Fp6Config>::Fp2Config as Fp2Config>::Fp, )
pub fn mul_by_fp2( &mut self, element: &QuadExtField<Fp2ConfigWrapper<<P as Fp6Config>::Fp2Config>>, )
pub fn mul_by_1( &mut self, c1: &QuadExtField<Fp2ConfigWrapper<<P as Fp6Config>::Fp2Config>>, )
pub fn mul_by_01( &mut self, c0: &QuadExtField<Fp2ConfigWrapper<<P as Fp6Config>::Fp2Config>>, c1: &QuadExtField<Fp2ConfigWrapper<<P as Fp6Config>::Fp2Config>>, )
Source§impl<P> CubicExtField<P>where
P: CubicExtConfig,
impl<P> CubicExtField<P>where
P: CubicExtConfig,
Sourcepub const fn new(
c0: <P as CubicExtConfig>::BaseField,
c1: <P as CubicExtConfig>::BaseField,
c2: <P as CubicExtConfig>::BaseField,
) -> CubicExtField<P>
pub const fn new( c0: <P as CubicExtConfig>::BaseField, c1: <P as CubicExtConfig>::BaseField, c2: <P as CubicExtConfig>::BaseField, ) -> CubicExtField<P>
Create a new field element from coefficients c0
, c1
and c2
so that the result is of the form c0 + c1 * X + c2 * X^2
.
§Examples
use ark_ff::models::cubic_extension::CubicExtField;
let c0: Fp2 = Fp2::rand(&mut test_rng());
let c1: Fp2 = Fp2::rand(&mut test_rng());
let c2: Fp2 = Fp2::rand(&mut test_rng());
// `Fp6` a degree-3 extension over `Fp2`.
let c: CubicExtField<Config> = Fp6::new(c0, c1, c2);
pub fn mul_assign_by_base_field( &mut self, value: &<P as CubicExtConfig>::BaseField, )
Sourcepub fn norm(&self) -> <P as CubicExtConfig>::BaseField
pub fn norm(&self) -> <P as CubicExtConfig>::BaseField
Calculate the norm of an element with respect to the base field
P::BaseField
. The norm maps an element a
in the extension field
Fq^m
to an element in the BaseField Fq
.
Norm(a) = a * a^q * a^(q^2)
Trait Implementations§
Source§impl<'a, 'b, P> Add<&'a CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
impl<'a, 'b, P> Add<&'a CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
+
operator.Source§fn add(self, other: &'a CubicExtField<P>) -> CubicExtField<P>
fn add(self, other: &'a CubicExtField<P>) -> CubicExtField<P>
Performs the
+
operation. Read moreSource§impl<'a, P> Add<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
impl<'a, P> Add<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
+
operator.Source§fn add(self, other: &CubicExtField<P>) -> CubicExtField<P>
fn add(self, other: &CubicExtField<P>) -> CubicExtField<P>
Performs the
+
operation. Read moreSource§impl<'a, 'b, P> Add<&'a mut CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
impl<'a, 'b, P> Add<&'a mut CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
+
operator.Source§fn add(self, other: &'a mut CubicExtField<P>) -> CubicExtField<P>
fn add(self, other: &'a mut CubicExtField<P>) -> CubicExtField<P>
Performs the
+
operation. Read moreSource§impl<'a, P> Add<&'a mut CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
impl<'a, P> Add<&'a mut CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
+
operator.Source§fn add(self, other: &'a mut CubicExtField<P>) -> CubicExtField<P>
fn add(self, other: &'a mut CubicExtField<P>) -> CubicExtField<P>
Performs the
+
operation. Read moreSource§impl<'b, P> Add<CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
impl<'b, P> Add<CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
+
operator.Source§fn add(self, other: CubicExtField<P>) -> CubicExtField<P>
fn add(self, other: CubicExtField<P>) -> CubicExtField<P>
Performs the
+
operation. Read moreSource§impl<P> Add for CubicExtField<P>where
P: CubicExtConfig,
impl<P> Add for CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
+
operator.Source§fn add(self, other: CubicExtField<P>) -> CubicExtField<P>
fn add(self, other: CubicExtField<P>) -> CubicExtField<P>
Performs the
+
operation. Read moreSource§impl<'a, P> AddAssign<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
impl<'a, P> AddAssign<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn add_assign(&mut self, other: &CubicExtField<P>)
fn add_assign(&mut self, other: &CubicExtField<P>)
Performs the
+=
operation. Read moreSource§impl<'a, P> AddAssign<&'a mut CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
impl<'a, P> AddAssign<&'a mut CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn add_assign(&mut self, other: &'a mut CubicExtField<P>)
fn add_assign(&mut self, other: &'a mut CubicExtField<P>)
Performs the
+=
operation. Read moreSource§impl<P> AddAssign for CubicExtField<P>where
P: CubicExtConfig,
impl<P> AddAssign for CubicExtField<P>where
P: CubicExtConfig,
Source§fn add_assign(&mut self, other: CubicExtField<P>)
fn add_assign(&mut self, other: CubicExtField<P>)
Performs the
+=
operation. Read moreSource§impl<P> AdditiveGroup for CubicExtField<P>where
P: CubicExtConfig,
impl<P> AdditiveGroup for CubicExtField<P>where
P: CubicExtConfig,
Source§const ZERO: CubicExtField<P> = _
const ZERO: CubicExtField<P> = _
The additive identity of the field.
type Scalar = CubicExtField<P>
Source§fn double(&self) -> CubicExtField<P>
fn double(&self) -> CubicExtField<P>
Doubles
self
.Source§fn double_in_place(&mut self) -> &mut CubicExtField<P>
fn double_in_place(&mut self) -> &mut CubicExtField<P>
Doubles
self
in place.Source§fn neg_in_place(&mut self) -> &mut CubicExtField<P>
fn neg_in_place(&mut self) -> &mut CubicExtField<P>
Negates
self
in place.Source§impl<P> CanonicalDeserialize for CubicExtField<P>where
P: CubicExtConfig,
impl<P> CanonicalDeserialize for CubicExtField<P>where
P: CubicExtConfig,
Source§fn deserialize_with_mode<R>(
reader: R,
compress: Compress,
validate: Validate,
) -> Result<CubicExtField<P>, SerializationError>where
R: Read,
fn deserialize_with_mode<R>(
reader: R,
compress: Compress,
validate: Validate,
) -> Result<CubicExtField<P>, SerializationError>where
R: Read,
The general deserialize method that takes in customization flags.
fn deserialize_compressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_compressed_unchecked<R>(
reader: R,
) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed<R>(reader: R) -> Result<Self, SerializationError>where
R: Read,
fn deserialize_uncompressed_unchecked<R>(
reader: R,
) -> Result<Self, SerializationError>where
R: Read,
Source§impl<P> CanonicalDeserializeWithFlags for CubicExtField<P>where
P: CubicExtConfig,
impl<P> CanonicalDeserializeWithFlags for CubicExtField<P>where
P: CubicExtConfig,
Source§fn deserialize_with_flags<R, F>(
reader: R,
) -> Result<(CubicExtField<P>, F), SerializationError>
fn deserialize_with_flags<R, F>( reader: R, ) -> Result<(CubicExtField<P>, F), SerializationError>
Reads
Self
and Flags
from reader
.
Returns empty flags by default.Source§impl<P> CanonicalSerialize for CubicExtField<P>where
P: CubicExtConfig,
impl<P> CanonicalSerialize for CubicExtField<P>where
P: CubicExtConfig,
Source§fn serialize_with_mode<W>(
&self,
writer: W,
_compress: Compress,
) -> Result<(), SerializationError>where
W: Write,
fn serialize_with_mode<W>(
&self,
writer: W,
_compress: Compress,
) -> Result<(), SerializationError>where
W: Write,
The general serialize method that takes in customization flags.
fn serialized_size(&self, _compress: Compress) -> usize
fn serialize_compressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn compressed_size(&self) -> usize
fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError>where
W: Write,
fn uncompressed_size(&self) -> usize
Source§impl<P> CanonicalSerializeWithFlags for CubicExtField<P>where
P: CubicExtConfig,
impl<P> CanonicalSerializeWithFlags for CubicExtField<P>where
P: CubicExtConfig,
Source§fn serialize_with_flags<W, F>(
&self,
writer: W,
flags: F,
) -> Result<(), SerializationError>
fn serialize_with_flags<W, F>( &self, writer: W, flags: F, ) -> Result<(), SerializationError>
Serializes
self
and flags
into writer
.Source§fn serialized_size_with_flags<F>(&self) -> usizewhere
F: Flags,
fn serialized_size_with_flags<F>(&self) -> usizewhere
F: Flags,
Serializes
self
and flags
into writer
.Source§impl<P> Clone for CubicExtField<P>
impl<P> Clone for CubicExtField<P>
Source§fn clone(&self) -> CubicExtField<P>
fn clone(&self) -> CubicExtField<P>
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<P> CyclotomicMultSubgroup for CubicExtField<Fp3ConfigWrapper<P>>where
P: Fp3Config,
impl<P> CyclotomicMultSubgroup for CubicExtField<Fp3ConfigWrapper<P>>where
P: Fp3Config,
Source§const INVERSE_IS_FAST: bool = false
const INVERSE_IS_FAST: bool = false
Is the inverse fast to compute? For example, in quadratic extensions, the inverse
can be computed at the cost of negating one coordinate, which is much faster than
standard inversion.
By default this is
false
, but should be set to true
for quadratic extensions.Source§fn cyclotomic_square(&self) -> Self
fn cyclotomic_square(&self) -> Self
Compute a square in the cyclotomic subgroup. By default this is computed using
Field::square
, but for
degree 12 extensions, this can be computed faster than normal squaring. Read moreSource§fn cyclotomic_square_in_place(&mut self) -> &mut Self
fn cyclotomic_square_in_place(&mut self) -> &mut Self
Square
self
in place. By default this is computed using
Field::square_in_place
, but for degree 12 extensions,
this can be computed faster than normal squaring. Read moreSource§fn cyclotomic_inverse(&self) -> Option<Self>
fn cyclotomic_inverse(&self) -> Option<Self>
Compute the inverse of
self
. See Self::INVERSE_IS_FAST
for details.
Returns None
if self.is_zero()
, and Some
otherwise. Read moreSource§fn cyclotomic_inverse_in_place(&mut self) -> Option<&mut Self>
fn cyclotomic_inverse_in_place(&mut self) -> Option<&mut Self>
Compute the inverse of
self
. See Self::INVERSE_IS_FAST
for details.
Returns None
if self.is_zero()
, and Some
otherwise. Read moreSource§fn cyclotomic_exp(&self, e: impl AsRef<[u64]>) -> Self
fn cyclotomic_exp(&self, e: impl AsRef<[u64]>) -> Self
Source§impl<P> CyclotomicMultSubgroup for CubicExtField<Fp6ConfigWrapper<P>>where
P: Fp6Config,
impl<P> CyclotomicMultSubgroup for CubicExtField<Fp6ConfigWrapper<P>>where
P: Fp6Config,
Source§const INVERSE_IS_FAST: bool = false
const INVERSE_IS_FAST: bool = false
Is the inverse fast to compute? For example, in quadratic extensions, the inverse
can be computed at the cost of negating one coordinate, which is much faster than
standard inversion.
By default this is
false
, but should be set to true
for quadratic extensions.Source§fn cyclotomic_square(&self) -> Self
fn cyclotomic_square(&self) -> Self
Compute a square in the cyclotomic subgroup. By default this is computed using
Field::square
, but for
degree 12 extensions, this can be computed faster than normal squaring. Read moreSource§fn cyclotomic_square_in_place(&mut self) -> &mut Self
fn cyclotomic_square_in_place(&mut self) -> &mut Self
Square
self
in place. By default this is computed using
Field::square_in_place
, but for degree 12 extensions,
this can be computed faster than normal squaring. Read moreSource§fn cyclotomic_inverse(&self) -> Option<Self>
fn cyclotomic_inverse(&self) -> Option<Self>
Compute the inverse of
self
. See Self::INVERSE_IS_FAST
for details.
Returns None
if self.is_zero()
, and Some
otherwise. Read moreSource§fn cyclotomic_inverse_in_place(&mut self) -> Option<&mut Self>
fn cyclotomic_inverse_in_place(&mut self) -> Option<&mut Self>
Compute the inverse of
self
. See Self::INVERSE_IS_FAST
for details.
Returns None
if self.is_zero()
, and Some
otherwise. Read moreSource§fn cyclotomic_exp(&self, e: impl AsRef<[u64]>) -> Self
fn cyclotomic_exp(&self, e: impl AsRef<[u64]>) -> Self
Source§impl<P> Debug for CubicExtField<P>
impl<P> Debug for CubicExtField<P>
Source§impl<P> Default for CubicExtField<P>
impl<P> Default for CubicExtField<P>
Source§fn default() -> CubicExtField<P>
fn default() -> CubicExtField<P>
Returns the “default value” for a type. Read more
Source§impl<P> Display for CubicExtField<P>where
P: CubicExtConfig,
impl<P> Display for CubicExtField<P>where
P: CubicExtConfig,
Source§impl<'a, 'b, P> Div<&'a CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
impl<'a, 'b, P> Div<&'a CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
/
operator.Source§fn div(self, other: &'a CubicExtField<P>) -> CubicExtField<P>
fn div(self, other: &'a CubicExtField<P>) -> CubicExtField<P>
Performs the
/
operation. Read moreSource§impl<'a, P> Div<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
impl<'a, P> Div<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
/
operator.Source§fn div(self, other: &CubicExtField<P>) -> CubicExtField<P>
fn div(self, other: &CubicExtField<P>) -> CubicExtField<P>
Performs the
/
operation. Read moreSource§impl<'a, 'b, P> Div<&'a mut CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
impl<'a, 'b, P> Div<&'a mut CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
/
operator.Source§fn div(self, other: &'a mut CubicExtField<P>) -> CubicExtField<P>
fn div(self, other: &'a mut CubicExtField<P>) -> CubicExtField<P>
Performs the
/
operation. Read moreSource§impl<'a, P> Div<&'a mut CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
impl<'a, P> Div<&'a mut CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
/
operator.Source§fn div(self, other: &'a mut CubicExtField<P>) -> CubicExtField<P>
fn div(self, other: &'a mut CubicExtField<P>) -> CubicExtField<P>
Performs the
/
operation. Read moreSource§impl<'b, P> Div<CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
impl<'b, P> Div<CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
/
operator.Source§fn div(self, other: CubicExtField<P>) -> CubicExtField<P>
fn div(self, other: CubicExtField<P>) -> CubicExtField<P>
Performs the
/
operation. Read moreSource§impl<P> Div for CubicExtField<P>where
P: CubicExtConfig,
impl<P> Div for CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
/
operator.Source§fn div(self, other: CubicExtField<P>) -> CubicExtField<P>
fn div(self, other: CubicExtField<P>) -> CubicExtField<P>
Performs the
/
operation. Read moreSource§impl<'a, P> DivAssign<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
impl<'a, P> DivAssign<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn div_assign(&mut self, other: &CubicExtField<P>)
fn div_assign(&mut self, other: &CubicExtField<P>)
Performs the
/=
operation. Read moreSource§impl<'a, P> DivAssign<&'a mut CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
impl<'a, P> DivAssign<&'a mut CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn div_assign(&mut self, other: &'a mut CubicExtField<P>)
fn div_assign(&mut self, other: &'a mut CubicExtField<P>)
Performs the
/=
operation. Read moreSource§impl<P> DivAssign for CubicExtField<P>where
P: CubicExtConfig,
impl<P> DivAssign for CubicExtField<P>where
P: CubicExtConfig,
Source§fn div_assign(&mut self, other: CubicExtField<P>)
fn div_assign(&mut self, other: CubicExtField<P>)
Performs the
/=
operation. Read moreSource§impl<P> FftField for CubicExtField<P>
impl<P> FftField for CubicExtField<P>
Source§const GENERATOR: CubicExtField<P> = _
const GENERATOR: CubicExtField<P> = _
The generator of the multiplicative group of the field
Source§const TWO_ADICITY: u32 = <P::BaseField>::TWO_ADICITY
const TWO_ADICITY: u32 = <P::BaseField>::TWO_ADICITY
Let
N
be the size of the multiplicative group defined by the field.
Then TWO_ADICITY
is the two-adicity of N
, i.e. the integer s
such that N = 2^s * t
for some odd integer t
.Source§const TWO_ADIC_ROOT_OF_UNITY: CubicExtField<P> = _
const TWO_ADIC_ROOT_OF_UNITY: CubicExtField<P> = _
2^s root of unity computed by GENERATOR^t
Source§const SMALL_SUBGROUP_BASE: Option<u32> = <P::BaseField>::SMALL_SUBGROUP_BASE
const SMALL_SUBGROUP_BASE: Option<u32> = <P::BaseField>::SMALL_SUBGROUP_BASE
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> = <P::BaseField>::SMALL_SUBGROUP_BASE_ADICITY
const SMALL_SUBGROUP_BASE_ADICITY: Option<u32> = <P::BaseField>::SMALL_SUBGROUP_BASE_ADICITY
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<CubicExtField<P>> = _
const LARGE_SUBGROUP_ROOT_OF_UNITY: Option<CubicExtField<P>> = _
GENERATOR^((MODULUS-1) / (2^s *
SMALL_SUBGROUP_BASE^SMALL_SUBGROUP_BASE_ADICITY)) Used for mixed-radix
FFT.
Source§fn get_root_of_unity(n: u64) -> Option<Self>
fn get_root_of_unity(n: u64) -> Option<Self>
Returns the root of unity of order n, if one exists.
If no small multiplicative subgroup is defined, this is the 2-adic root
of unity of order n (for n a power of 2).
If a small multiplicative subgroup is defined, this is the root of unity
of order n for the larger subgroup generated by
FftConfig::LARGE_SUBGROUP_ROOT_OF_UNITY
(for n = 2^i * FftConfig::SMALL_SUBGROUP_BASE^j for some i, j).Source§impl<P> Field for CubicExtField<P>where
P: CubicExtConfig,
impl<P> Field for CubicExtField<P>where
P: CubicExtConfig,
Source§fn legendre(&self) -> LegendreSymbol
fn legendre(&self) -> LegendreSymbol
Returns the Legendre symbol.
Source§const SQRT_PRECOMP: Option<SqrtPrecomputation<CubicExtField<P>>> = P::SQRT_PRECOMP
const SQRT_PRECOMP: Option<SqrtPrecomputation<CubicExtField<P>>> = P::SQRT_PRECOMP
Determines the algorithm for computing square roots.
Source§const ONE: CubicExtField<P> = _
const ONE: CubicExtField<P> = _
The multiplicative identity of the field.
type BasePrimeField = <P as CubicExtConfig>::BasePrimeField
Source§fn extension_degree() -> u64
fn extension_degree() -> u64
Returns the extension degree of this field with respect
to
Self::BasePrimeField
.Source§fn from_base_prime_field(
elem: <CubicExtField<P> as Field>::BasePrimeField,
) -> CubicExtField<P>
fn from_base_prime_field( elem: <CubicExtField<P> as Field>::BasePrimeField, ) -> CubicExtField<P>
Constructs a field element from a single base prime field elements. Read more
fn to_base_prime_field_elements( &self, ) -> impl Iterator<Item = <CubicExtField<P> as Field>::BasePrimeField>
Source§fn from_base_prime_field_elems(
elems: impl IntoIterator<Item = <CubicExtField<P> as Field>::BasePrimeField>,
) -> Option<CubicExtField<P>>
fn from_base_prime_field_elems( elems: impl IntoIterator<Item = <CubicExtField<P> as Field>::BasePrimeField>, ) -> Option<CubicExtField<P>>
Convert a slice of base prime field elements into a field element.
If the slice length != Self::extension_degree(), must return None.
Source§fn from_random_bytes_with_flags<F>(
bytes: &[u8],
) -> Option<(CubicExtField<P>, F)>where
F: Flags,
fn from_random_bytes_with_flags<F>(
bytes: &[u8],
) -> Option<(CubicExtField<P>, F)>where
F: Flags,
Attempt to deserialize a field element, splitting the bitflags metadata
according to
F
specification. Returns None
if the deserialization
fails. Read moreSource§fn from_random_bytes(bytes: &[u8]) -> Option<CubicExtField<P>>
fn from_random_bytes(bytes: &[u8]) -> Option<CubicExtField<P>>
Attempt to deserialize a field element. Returns
None
if the
deserialization fails. Read moreSource§fn square(&self) -> CubicExtField<P>
fn square(&self) -> CubicExtField<P>
Returns
self * self
.Source§fn square_in_place(&mut self) -> &mut CubicExtField<P>
fn square_in_place(&mut self) -> &mut CubicExtField<P>
Squares
self
in place.Source§fn inverse(&self) -> Option<CubicExtField<P>>
fn inverse(&self) -> Option<CubicExtField<P>>
Computes the multiplicative inverse of
self
if self
is nonzero.Source§fn inverse_in_place(&mut self) -> Option<&mut CubicExtField<P>>
fn inverse_in_place(&mut self) -> Option<&mut CubicExtField<P>>
If
self.inverse().is_none()
, this just returns None
. Otherwise, it sets
self
to self.inverse().unwrap()
.Source§fn frobenius_map_in_place(&mut self, power: usize)
fn frobenius_map_in_place(&mut self, power: usize)
Sets
self
to self^s
, where s = Self::BasePrimeField::MODULUS^power
.
This is also called the Frobenius automorphism.fn mul_by_base_prime_field( &self, elem: &<CubicExtField<P> as Field>::BasePrimeField, ) -> CubicExtField<P>
Source§fn characteristic() -> &'static [u64]
fn characteristic() -> &'static [u64]
Returns the characteristic of the field,
in little-endian representation.
Source§fn sqrt_in_place(&mut self) -> Option<&mut Self>
fn sqrt_in_place(&mut self) -> Option<&mut Self>
Sets
self
to be the square root of self
, if it exists.Source§fn sum_of_products<const T: usize>(a: &[Self; T], b: &[Self; T]) -> Self
fn sum_of_products<const T: usize>(a: &[Self; T], b: &[Self; T]) -> Self
Returns
sum([a_i * b_i])
.Source§fn frobenius_map(&self, power: usize) -> Self
fn frobenius_map(&self, power: usize) -> Self
Returns
self^s
, where s = Self::BasePrimeField::MODULUS^power
.
This is also called the Frobenius automorphism.Source§fn pow<S>(&self, exp: S) -> Self
fn pow<S>(&self, exp: S) -> Self
Returns
self^exp
, where exp
is an integer represented with u64
limbs,
least significant limb first.Source§fn pow_with_table<S>(powers_of_2: &[Self], exp: S) -> Option<Self>
fn pow_with_table<S>(powers_of_2: &[Self], exp: S) -> Option<Self>
Exponentiates a field element
f
by a number represented with u64
limbs, using a precomputed table containing as many powers of 2 of
f
as the 1 + the floor of log2 of the exponent exp
, starting
from the 1st power. That is, powers_of_2
should equal &[p, p^2, p^4, ..., p^(2^n)]
when exp
has at most n
bits. Read moreSource§impl<P> From<bool> for CubicExtField<P>where
P: CubicExtConfig,
impl<P> From<bool> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn from(other: bool) -> CubicExtField<P>
fn from(other: bool) -> CubicExtField<P>
Converts to this type from the input type.
Source§impl<P> From<i128> for CubicExtField<P>where
P: CubicExtConfig,
impl<P> From<i128> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn from(val: i128) -> CubicExtField<P>
fn from(val: i128) -> CubicExtField<P>
Converts to this type from the input type.
Source§impl<P> From<i16> for CubicExtField<P>where
P: CubicExtConfig,
impl<P> From<i16> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn from(val: i16) -> CubicExtField<P>
fn from(val: i16) -> CubicExtField<P>
Converts to this type from the input type.
Source§impl<P> From<i32> for CubicExtField<P>where
P: CubicExtConfig,
impl<P> From<i32> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn from(val: i32) -> CubicExtField<P>
fn from(val: i32) -> CubicExtField<P>
Converts to this type from the input type.
Source§impl<P> From<i64> for CubicExtField<P>where
P: CubicExtConfig,
impl<P> From<i64> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn from(val: i64) -> CubicExtField<P>
fn from(val: i64) -> CubicExtField<P>
Converts to this type from the input type.
Source§impl<P> From<i8> for CubicExtField<P>where
P: CubicExtConfig,
impl<P> From<i8> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn from(val: i8) -> CubicExtField<P>
fn from(val: i8) -> CubicExtField<P>
Converts to this type from the input type.
Source§impl<P> From<u128> for CubicExtField<P>where
P: CubicExtConfig,
impl<P> From<u128> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn from(other: u128) -> CubicExtField<P>
fn from(other: u128) -> CubicExtField<P>
Converts to this type from the input type.
Source§impl<P> From<u16> for CubicExtField<P>where
P: CubicExtConfig,
impl<P> From<u16> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn from(other: u16) -> CubicExtField<P>
fn from(other: u16) -> CubicExtField<P>
Converts to this type from the input type.
Source§impl<P> From<u32> for CubicExtField<P>where
P: CubicExtConfig,
impl<P> From<u32> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn from(other: u32) -> CubicExtField<P>
fn from(other: u32) -> CubicExtField<P>
Converts to this type from the input type.
Source§impl<P> From<u64> for CubicExtField<P>where
P: CubicExtConfig,
impl<P> From<u64> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn from(other: u64) -> CubicExtField<P>
fn from(other: u64) -> CubicExtField<P>
Converts to this type from the input type.
Source§impl<P> From<u8> for CubicExtField<P>where
P: CubicExtConfig,
impl<P> From<u8> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn from(other: u8) -> CubicExtField<P>
fn from(other: u8) -> CubicExtField<P>
Converts to this type from the input type.
Source§impl<P> Hash for CubicExtField<P>
impl<P> Hash for CubicExtField<P>
Source§impl<'a, 'b, P> Mul<&'a CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
impl<'a, 'b, P> Mul<&'a CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
*
operator.Source§fn mul(self, other: &'a CubicExtField<P>) -> CubicExtField<P>
fn mul(self, other: &'a CubicExtField<P>) -> CubicExtField<P>
Performs the
*
operation. Read moreSource§impl<'a, P> Mul<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
impl<'a, P> Mul<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
*
operator.Source§fn mul(self, other: &CubicExtField<P>) -> CubicExtField<P>
fn mul(self, other: &CubicExtField<P>) -> CubicExtField<P>
Performs the
*
operation. Read moreSource§impl<'a, 'b, P> Mul<&'a mut CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
impl<'a, 'b, P> Mul<&'a mut CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
*
operator.Source§fn mul(self, other: &'a mut CubicExtField<P>) -> CubicExtField<P>
fn mul(self, other: &'a mut CubicExtField<P>) -> CubicExtField<P>
Performs the
*
operation. Read moreSource§impl<'a, P> Mul<&'a mut CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
impl<'a, P> Mul<&'a mut CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
*
operator.Source§fn mul(self, other: &'a mut CubicExtField<P>) -> CubicExtField<P>
fn mul(self, other: &'a mut CubicExtField<P>) -> CubicExtField<P>
Performs the
*
operation. Read moreSource§impl<'b, P> Mul<CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
impl<'b, P> Mul<CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
*
operator.Source§fn mul(self, other: CubicExtField<P>) -> CubicExtField<P>
fn mul(self, other: CubicExtField<P>) -> CubicExtField<P>
Performs the
*
operation. Read moreSource§impl<P> Mul for CubicExtField<P>where
P: CubicExtConfig,
impl<P> Mul for CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
*
operator.Source§fn mul(self, other: CubicExtField<P>) -> CubicExtField<P>
fn mul(self, other: CubicExtField<P>) -> CubicExtField<P>
Performs the
*
operation. Read moreSource§impl<'a, P> MulAssign<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
impl<'a, P> MulAssign<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn mul_assign(&mut self, other: &CubicExtField<P>)
fn mul_assign(&mut self, other: &CubicExtField<P>)
Performs the
*=
operation. Read moreSource§impl<'a, P> MulAssign<&'a mut CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
impl<'a, P> MulAssign<&'a mut CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn mul_assign(&mut self, other: &'a mut CubicExtField<P>)
fn mul_assign(&mut self, other: &'a mut CubicExtField<P>)
Performs the
*=
operation. Read moreSource§impl<P> MulAssign for CubicExtField<P>where
P: CubicExtConfig,
impl<P> MulAssign for CubicExtField<P>where
P: CubicExtConfig,
Source§fn mul_assign(&mut self, other: CubicExtField<P>)
fn mul_assign(&mut self, other: CubicExtField<P>)
Performs the
*=
operation. Read moreSource§impl<P> Neg for CubicExtField<P>where
P: CubicExtConfig,
impl<P> Neg for CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
-
operator.Source§fn neg(self) -> CubicExtField<P>
fn neg(self) -> CubicExtField<P>
Performs the unary
-
operation. Read moreSource§impl<P> One for CubicExtField<P>where
P: CubicExtConfig,
impl<P> One for CubicExtField<P>where
P: CubicExtConfig,
Source§impl<P> Ord for CubicExtField<P>where
P: CubicExtConfig,
impl<P> Ord for CubicExtField<P>where
P: CubicExtConfig,
CubicExtField
elements are ordered lexicographically.
Source§fn cmp(&self, other: &CubicExtField<P>) -> Ordering
fn cmp(&self, other: &CubicExtField<P>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<P> PartialEq for CubicExtField<P>
impl<P> PartialEq for CubicExtField<P>
Source§impl<P> PartialOrd for CubicExtField<P>where
P: CubicExtConfig,
impl<P> PartialOrd for CubicExtField<P>where
P: CubicExtConfig,
Source§impl<'a, P> Product<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
impl<'a, P> Product<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn product<I>(iter: I) -> CubicExtField<P>where
I: Iterator<Item = &'a CubicExtField<P>>,
fn product<I>(iter: I) -> CubicExtField<P>where
I: Iterator<Item = &'a CubicExtField<P>>,
Takes an iterator and generates
Self
from the elements by multiplying
the items.Source§impl<P> Product for CubicExtField<P>where
P: CubicExtConfig,
impl<P> Product for CubicExtField<P>where
P: CubicExtConfig,
Source§fn product<I>(iter: I) -> CubicExtField<P>where
I: Iterator<Item = CubicExtField<P>>,
fn product<I>(iter: I) -> CubicExtField<P>where
I: Iterator<Item = CubicExtField<P>>,
Takes an iterator and generates
Self
from the elements by multiplying
the items.Source§impl<'a, 'b, P> Sub<&'a CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
impl<'a, 'b, P> Sub<&'a CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
-
operator.Source§fn sub(self, other: &'a CubicExtField<P>) -> CubicExtField<P>
fn sub(self, other: &'a CubicExtField<P>) -> CubicExtField<P>
Performs the
-
operation. Read moreSource§impl<'a, P> Sub<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
impl<'a, P> Sub<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
-
operator.Source§fn sub(self, other: &CubicExtField<P>) -> CubicExtField<P>
fn sub(self, other: &CubicExtField<P>) -> CubicExtField<P>
Performs the
-
operation. Read moreSource§impl<'a, 'b, P> Sub<&'a mut CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
impl<'a, 'b, P> Sub<&'a mut CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
-
operator.Source§fn sub(self, other: &'a mut CubicExtField<P>) -> CubicExtField<P>
fn sub(self, other: &'a mut CubicExtField<P>) -> CubicExtField<P>
Performs the
-
operation. Read moreSource§impl<'a, P> Sub<&'a mut CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
impl<'a, P> Sub<&'a mut CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
-
operator.Source§fn sub(self, other: &'a mut CubicExtField<P>) -> CubicExtField<P>
fn sub(self, other: &'a mut CubicExtField<P>) -> CubicExtField<P>
Performs the
-
operation. Read moreSource§impl<'b, P> Sub<CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
impl<'b, P> Sub<CubicExtField<P>> for &'b CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
-
operator.Source§fn sub(self, other: CubicExtField<P>) -> CubicExtField<P>
fn sub(self, other: CubicExtField<P>) -> CubicExtField<P>
Performs the
-
operation. Read moreSource§impl<P> Sub for CubicExtField<P>where
P: CubicExtConfig,
impl<P> Sub for CubicExtField<P>where
P: CubicExtConfig,
Source§type Output = CubicExtField<P>
type Output = CubicExtField<P>
The resulting type after applying the
-
operator.Source§fn sub(self, other: CubicExtField<P>) -> CubicExtField<P>
fn sub(self, other: CubicExtField<P>) -> CubicExtField<P>
Performs the
-
operation. Read moreSource§impl<'a, P> SubAssign<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
impl<'a, P> SubAssign<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn sub_assign(&mut self, other: &CubicExtField<P>)
fn sub_assign(&mut self, other: &CubicExtField<P>)
Performs the
-=
operation. Read moreSource§impl<'a, P> SubAssign<&'a mut CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
impl<'a, P> SubAssign<&'a mut CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn sub_assign(&mut self, other: &'a mut CubicExtField<P>)
fn sub_assign(&mut self, other: &'a mut CubicExtField<P>)
Performs the
-=
operation. Read moreSource§impl<P> SubAssign for CubicExtField<P>where
P: CubicExtConfig,
impl<P> SubAssign for CubicExtField<P>where
P: CubicExtConfig,
Source§fn sub_assign(&mut self, other: CubicExtField<P>)
fn sub_assign(&mut self, other: CubicExtField<P>)
Performs the
-=
operation. Read moreSource§impl<'a, P> Sum<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
impl<'a, P> Sum<&'a CubicExtField<P>> for CubicExtField<P>where
P: CubicExtConfig,
Source§fn sum<I>(iter: I) -> CubicExtField<P>where
I: Iterator<Item = &'a CubicExtField<P>>,
fn sum<I>(iter: I) -> CubicExtField<P>where
I: Iterator<Item = &'a CubicExtField<P>>,
Takes an iterator and generates
Self
from the elements by “summing up”
the items.Source§impl<P> Sum for CubicExtField<P>where
P: CubicExtConfig,
impl<P> Sum for CubicExtField<P>where
P: CubicExtConfig,
Source§fn sum<I>(iter: I) -> CubicExtField<P>where
I: Iterator<Item = CubicExtField<P>>,
fn sum<I>(iter: I) -> CubicExtField<P>where
I: Iterator<Item = CubicExtField<P>>,
Takes an iterator and generates
Self
from the elements by “summing up”
the items.Source§impl<P> ToConstraintField<<P as CubicExtConfig>::BasePrimeField> for CubicExtField<P>where
P: CubicExtConfig,
<P as CubicExtConfig>::BaseField: ToConstraintField<<P as CubicExtConfig>::BasePrimeField>,
impl<P> ToConstraintField<<P as CubicExtConfig>::BasePrimeField> for CubicExtField<P>where
P: CubicExtConfig,
<P as CubicExtConfig>::BaseField: ToConstraintField<<P as CubicExtConfig>::BasePrimeField>,
fn to_field_elements( &self, ) -> Option<Vec<<P as CubicExtConfig>::BasePrimeField>>
Source§impl<P> Valid for CubicExtField<P>where
P: CubicExtConfig,
impl<P> Valid for CubicExtField<P>where
P: CubicExtConfig,
fn check(&self) -> Result<(), SerializationError>
fn batch_check<'a>(
batch: impl Iterator<Item = &'a Self> + Send,
) -> Result<(), SerializationError>where
Self: 'a,
Source§impl<P> Zero for CubicExtField<P>where
P: CubicExtConfig,
impl<P> Zero for CubicExtField<P>where
P: CubicExtConfig,
Source§impl<P> Zeroize for CubicExtField<P>where
P: CubicExtConfig,
impl<P> Zeroize for CubicExtField<P>where
P: CubicExtConfig,
impl<P> Copy for CubicExtField<P>
impl<P> Eq for CubicExtField<P>
Auto Trait Implementations§
impl<P> Freeze for CubicExtField<P>
impl<P> RefUnwindSafe for CubicExtField<P>
impl<P> Send for CubicExtField<P>
impl<P> Sync for CubicExtField<P>
impl<P> Unpin for CubicExtField<P>
impl<P> UnwindSafe for CubicExtField<P>
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> CanonicalSerializeHashExt for Twhere
T: CanonicalSerialize,
impl<T> CanonicalSerializeHashExt for Twhere
T: CanonicalSerialize,
fn hash<H>(&self) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>where
H: Digest,
fn hash_uncompressed<H>(
&self,
) -> GenericArray<u8, <H as OutputSizeUser>::OutputSize>where
H: Digest,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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