Struct ark_ff::fields::models::Fp320 [−][src]
pub struct Fp320<P>(pub BigInteger320, _);
Expand description
Represents an element of the prime field F_p, where p == P::MODULUS
.
This type can represent elements in any field of size at most
320
bits.
Implementations
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
.
Outputs a string containing the value of self
, chunked up into
64-bit limbs.
Computes self *= other.inverse()
if other.inverse()
is Some
, and
panics otherwise.
Performs the /=
operation. Read more
Performs the /=
operation. Read more
Performs the /=
operation. Read more
type FftParams = P
Returns the 2^s root of unity.
Returns the 2^s * small_subgroup_base^small_subgroup_base_adicity root of unity if a small subgroup is defined. Read more
Returns the multiplicative generator of char()
- 1 order.
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 FftParams::LARGE_SUBGROUP_ROOT_OF_UNITY
(for n = 2^i * FftParams::SMALL_SUBGROUP_BASE^j for some i, j). Read more
The Frobenius map has no effect in a prime field.
type BasePrimeField = Self
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 the characteristic of the field, in little-endian representation. Read more
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
Squares self
in place.
Computes the multiplicative inverse of self
if self
is nonzero.
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
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 conversion.
Performs the *=
operation. Read more
Performs the *=
operation. Read more
Performs the *=
operation. Read more
Note that this implementation of Ord
compares field elements viewing
them as integers in the range 0, 1, …, P::MODULUS - 1. However, other
implementations of PrimeField
might choose a different ordering, and
as such, users should use this Ord
for applications where
any ordering suffices (like in a BTreeMap), and not in applications
where a particular ordering is required.
Note that this implementation of PartialOrd
compares field elements viewing
them as integers in the range 0, 1, …, P::MODULUS
- 1. However, other
implementations of PrimeField
might choose a different ordering, and
as such, users should use this PartialOrd
for applications where
any ordering suffices (like in a BTreeMap), and not in applications
where a particular ordering is required.
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
type Params = P
type BigInt = BigInteger320
Returns a prime field element from its underlying representation.
Returns the underlying representation of the prime field element.
Reads bytes in big-endian, and converts them to a field element. If the bytes are larger than the modulus, it will reduce them. Read more
Reads bytes in little-endian, and converts them to a field element. If the bytes are larger than the modulus, it will reduce them. Read more
Return the QNR^t, for t defined by
2^s * t = MODULUS - 1
, and t coprime to 2. Read more
Returns the field size in bits.
Returns the trace minus one divided by two.
Returns the modulus minus one divided by two.
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
Auto Trait Implementations
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