Struct ark_ff::fields::models::quadratic_extension::QuadExtField [−][src]
pub struct QuadExtField<P: QuadExtParameters> { pub c0: P::BaseField, pub c1: P::BaseField, // some fields omitted }
Expand description
An element of a quadratic extension field F_p[X]/(X^2 - P::NONRESIDUE) is
represented as c0 + c1 * X, for c0, c1 in P::BaseField
.
Fields
c0: P::BaseField
c1: P::BaseField
Implementations
pub fn mul_by_034(
&mut self,
c0: &<P::Fp3Params as Fp3Parameters>::Fp,
c3: &<P::Fp3Params as Fp3Parameters>::Fp,
c4: &<P::Fp3Params as Fp3Parameters>::Fp
)
[src]pub fn mul_by_014(
&mut self,
c0: &<P::Fp3Params as Fp3Parameters>::Fp,
c1: &<P::Fp3Params as Fp3Parameters>::Fp,
c4: &<P::Fp3Params as Fp3Parameters>::Fp
)
[src]pub fn mul_by_fp(
&mut self,
element: &<<P::Fp6Params as Fp6Parameters>::Fp2Params as Fp2Parameters>::Fp
)
[src]pub fn mul_by_034(
&mut self,
c0: &Fp2<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params>,
c3: &Fp2<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params>,
c4: &Fp2<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params>
)
[src]pub fn mul_by_014(
&mut self,
c0: &Fp2<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params>,
c1: &Fp2<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params>,
c4: &Fp2<<<P as Fp12Parameters>::Fp6Params as Fp6Parameters>::Fp2Params>
)
[src]This is only to be used when the element is known to be in the cyclotomic subgroup.
This is only to be used when the element is known to be in the cyclotomic subgroup.
Norm of QuadExtField over P::BaseField
:Norm(a) = a * a.conjugate()
.
This simplifies to: Norm(a) = a.x^2 - P::NON_RESIDUE * a.y^2
.
This is alternatively expressed as Norm(a) = a^(1 + p)
.
Trait Implementations
Performs the +=
operation. Read more
Performs the +=
operation. Read more
Performs the +=
operation. Read more
Reads Self
from reader
.
Reads Self
from reader
without compression.
Reads self
from reader
without compression, and without performing
validity checks. Should be used only when the input is trusted. Read more
fn deserialize_with_flags<R: Read, F: Flags>(
reader: R
) -> Result<(Self, F), SerializationError>
[src]
fn deserialize_with_flags<R: Read, F: Flags>(
reader: R
) -> Result<(Self, F), SerializationError>
[src]Reads Self
and Flags
from reader
.
Returns empty flags by default. Read more
Serializes self
into writer
.
It is left up to a particular type for how it strikes the
serialization efficiency vs compression tradeoff.
For standard types (e.g. bool
, lengths, etc.) typically an uncompressed
form is used, whereas for algebraic types compressed forms are used. Read more
fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError> where
W: Write,
[src]
fn serialize_uncompressed<W>(&self, writer: W) -> Result<(), SerializationError> where
W: Write,
[src]Serializes self
into writer
without compression.
Serializes self
into writer
without compression, and without
performing validity checks. Should be used only when there is no
danger of adversarial manipulation of the output. Read more
fn serialize_with_flags<W: Write, F: Flags>(
&self,
writer: W,
flags: F
) -> Result<(), SerializationError>
[src]
fn serialize_with_flags<W: Write, F: Flags>(
&self,
writer: W,
flags: F
) -> Result<(), SerializationError>
[src]Serializes self
and flags
into writer
.
Serializes self
and flags
into writer
.
Performs the /=
operation. Read more
Performs the /=
operation. Read more
Performs the /=
operation. Read more
type BasePrimeField = P::BasePrimeField
Returns the extension degree of this field with respect
to Self::BasePrimeField
. Read more
Convert a slice of base prime field elements into a field element. If the slice length != Self::extension_degree(), must return None. Read more
Doubles self
in place.
Returns a field element with an extra sign bit used for group parsing if the set of bytes forms a valid field element, otherwise returns None. This function is primarily intended for sampling random field elements from a hash-function or RNG output. Read more
Returns a field element if the set of bytes forms a valid field element, otherwise returns None. This function is primarily intended for sampling random field elements from a hash-function or RNG output. Read more
Squares self
in place.
Computes the multiplicative inverse of self
if self
is nonzero.
Exponentiates this element by a power of the base prime modulus via the Frobenius automorphism. Read more
Returns the characteristic of the field, in little-endian representation. Read more
Exponentiates this element by a number represented with u64
limbs,
least significant limb first. Read more
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 more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
QuadExtField
elements are ordered lexicographically.
impl<P: QuadExtParameters> PartialEq<QuadExtField<P>> for QuadExtField<P> where
P: QuadExtParameters,
[src]
impl<P: QuadExtParameters> PartialEq<QuadExtField<P>> for QuadExtField<P> where
P: QuadExtParameters,
[src]This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
impl<'a, P: QuadExtParameters> SquareRootField for QuadExtField<P> where
P::BaseField: SquareRootField,
[src]
impl<'a, P: QuadExtParameters> SquareRootField for QuadExtField<P> where
P::BaseField: SquareRootField,
[src]Returns a LegendreSymbol
, which indicates whether this field element is
1 : a quadratic residue
0 : equal to 0
-1 : a quadratic non-residue Read more
Sets self
to be the square root of self
, if it exists.
Performs the -=
operation. Read more
Performs the -=
operation. Read more
Performs the -=
operation. Read more
impl<P: QuadExtParameters> ToConstraintField<<P as QuadExtParameters>::BasePrimeField> for QuadExtField<P> where
P::BaseField: ToConstraintField<P::BasePrimeField>,
[src]
impl<P: QuadExtParameters> ToConstraintField<<P as QuadExtParameters>::BasePrimeField> for QuadExtField<P> where
P::BaseField: ToConstraintField<P::BasePrimeField>,
[src]Auto Trait Implementations
impl<P> Send for QuadExtField<P>
impl<P> Sync for QuadExtField<P>
impl<P> Unpin for QuadExtField<P> where
P: Unpin,
<P as QuadExtParameters>::BaseField: Unpin,
Blanket Implementations
Mutably borrows from an owned value. Read more
fn hash_uncompressed<H>(&self) -> GenericArray<u8, <H as Digest>::OutputSize> where
H: Digest,
[src]type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V