pub type Fq2 = QuadExtField<Fq>;
Aliased Type§
struct Fq2 { /* private fields */ }
Implementations§
Source§impl Fq2
impl Fq2
Sourcepub fn from_bytes(bytes: &[u8; 64]) -> CtOption<Fq2>
pub fn from_bytes(bytes: &[u8; 64]) -> CtOption<Fq2>
Attempts to convert a little-endian byte representation of
a scalar into a $base
, failing if the input is not canonical.
Sourcepub fn to_bytes(&self) -> [u8; 64]
pub fn to_bytes(&self) -> [u8; 64]
Converts an element of $base
into a byte representation in
little-endian byte order.
Sourcepub fn lexicographically_largest(&self) -> Choice
pub fn lexicographically_largest(&self) -> Choice
Returns whether or not this element is strictly lexicographically larger than its negation.
Trait Implementations§
Source§impl<'b> AddAssign<&'b QuadExtField<Fq>> for Fq2
impl<'b> AddAssign<&'b QuadExtField<Fq>> for Fq2
Source§fn add_assign(&mut self, rhs: &'b Fq2)
fn add_assign(&mut self, rhs: &'b Fq2)
Performs the
+=
operation. Read moreSource§impl AddAssign for Fq2
impl AddAssign for Fq2
Source§fn add_assign(&mut self, rhs: Fq2)
fn add_assign(&mut self, rhs: Fq2)
Performs the
+=
operation. Read moreSource§impl EndianRepr for Fq2
impl EndianRepr for Fq2
Source§impl ExtField for Fq2
impl ExtField for Fq2
const NON_RESIDUE: Self = _
fn mul_by_nonresidue(&self) -> Self
fn frobenius_map(&mut self, power: usize)
Source§impl FromUniformBytes<96> for Fq2
impl FromUniformBytes<96> for Fq2
Source§fn from_uniform_bytes(bytes: &[u8; 96]) -> Self
fn from_uniform_bytes(bytes: &[u8; 96]) -> Self
Returns a field element that is congruent to the provided little endian unsigned
byte representation of an integer.
Source§impl<'b> MulAssign<&'b QuadExtField<Fq>> for Fq2
impl<'b> MulAssign<&'b QuadExtField<Fq>> for Fq2
Source§fn mul_assign(&mut self, rhs: &'b Fq2)
fn mul_assign(&mut self, rhs: &'b Fq2)
Performs the
*=
operation. Read moreSource§impl MulAssign for Fq2
impl MulAssign for Fq2
Source§fn mul_assign(&mut self, rhs: Fq2)
fn mul_assign(&mut self, rhs: Fq2)
Performs the
*=
operation. Read moreSource§impl Ord for Fq2
impl Ord for Fq2
Source§impl PartialOrd for Fq2
impl PartialOrd for Fq2
Source§impl PrimeField for Fq2
impl PrimeField for Fq2
Source§const MODULUS: &'static str = <Fq as PrimeField>::MODULUS
const MODULUS: &'static str = <Fq as PrimeField>::MODULUS
Modulus of the field written as a string for debugging purposes. Read more
Source§const MULTIPLICATIVE_GENERATOR: Self = _
const MULTIPLICATIVE_GENERATOR: Self = _
A fixed multiplicative generator of
modulus - 1
order. This element must also be
a quadratic nonresidue. Read moreSource§const CAPACITY: u32 = 254u32
const CAPACITY: u32 = 254u32
How many bits of information can be reliably stored in the field element. Read more
Source§const ROOT_OF_UNITY: Self = Fq2::ZERO
const ROOT_OF_UNITY: Self = Fq2::ZERO
The
2^s
root of unity. Read moreSource§const ROOT_OF_UNITY_INV: Self = Fq2::ZERO
const ROOT_OF_UNITY_INV: Self = Fq2::ZERO
Inverse of
Self::ROOT_OF_UNITY
.Source§type Repr = Repr<{ $base::SIZE * 2 }>
type Repr = Repr<{ $base::SIZE * 2 }>
The prime field can be converted back and forth into this binary
representation.
Source§fn from_repr(repr: Self::Repr) -> CtOption<Self>
fn from_repr(repr: Self::Repr) -> CtOption<Self>
Attempts to convert a byte representation of a field element into an element of
this prime field, failing if the input is not canonical (is not smaller than the
field’s modulus). Read more
Source§fn to_repr(&self) -> Self::Repr
fn to_repr(&self) -> Self::Repr
Converts an element of the prime field into the standard byte representation for
this field. Read more
Source§fn from_str_vartime(s: &str) -> Option<Self>
fn from_str_vartime(s: &str) -> Option<Self>
Interpret a string of numbers as a (congruent) prime field element.
Does not accept unnecessary leading zeroes or a blank string. Read more
Source§impl QuadExtFieldArith for Fq2
impl QuadExtFieldArith for Fq2
const SQRT: SQRT<Fq> = _
type Base = Fq
fn square_assign(el: &mut QuadExtField<Self::Base>)
fn mul_assign( lhs: &mut QuadExtField<Self::Base>, rhs: &QuadExtField<Self::Base>, )
Source§impl SerdeObject for Fq2
impl SerdeObject for Fq2
Source§fn from_raw_bytes_unchecked(bytes: &[u8]) -> Self
fn from_raw_bytes_unchecked(bytes: &[u8]) -> Self
The purpose of unchecked functions is to read the internal memory representation
of a type from bytes as quickly as possible. No sanitization checks are performed
to ensure the bytes represent a valid object. As such this function should only be
used internally as an extension of machine memory. It should not be used to deserialize
externally provided data.
fn from_raw_bytes(bytes: &[u8]) -> Option<Self>
fn to_raw_bytes(&self) -> Vec<u8>
Source§fn read_raw_unchecked<R: Read>(reader: &mut R) -> Self
fn read_raw_unchecked<R: Read>(reader: &mut R) -> Self
The purpose of unchecked functions is to read the internal memory representation
of a type from disk as quickly as possible. No sanitization checks are performed
to ensure the bytes represent a valid object. This function should only be used
internally when some machine state cannot be kept in memory (e.g., between runs)
and needs to be reloaded as quickly as possible.
fn read_raw<R: Read>(reader: &mut R) -> Result<Self>
fn write_raw<W: Write>(&self, writer: &mut W) -> Result<()>
Source§impl<'b> SubAssign<&'b QuadExtField<Fq>> for Fq2
impl<'b> SubAssign<&'b QuadExtField<Fq>> for Fq2
Source§fn sub_assign(&mut self, rhs: &'b Fq2)
fn sub_assign(&mut self, rhs: &'b Fq2)
Performs the
-=
operation. Read moreSource§impl SubAssign for Fq2
impl SubAssign for Fq2
Source§fn sub_assign(&mut self, rhs: Fq2)
fn sub_assign(&mut self, rhs: Fq2)
Performs the
-=
operation. Read more