Trait ark_ff::fields::Field [−][src]
The interface for a generic field.
Associated Types
Loading content...Required methods
fn extension_degree() -> u64
[src]
Returns the extension degree of this field with respect
to Self::BasePrimeField
.
fn from_base_prime_field_elems(elems: &[Self::BasePrimeField]) -> Option<Self>
[src]
Convert a slice of base prime field elements into a field element. If the slice length != Self::extension_degree(), must return None.
#[must_use]fn double(&self) -> Self
[src]
Returns self + self
.
fn double_in_place(&mut self) -> &mut Self
[src]
Doubles self
in place.
fn from_random_bytes_with_flags<F: Flags>(bytes: &[u8]) -> Option<(Self, F)>
[src]
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.
#[must_use]fn square(&self) -> Self
[src]
Returns self * self
.
fn square_in_place(&mut self) -> &mut Self
[src]
Squares self
in place.
#[must_use]fn inverse(&self) -> Option<Self>
[src]
Computes the multiplicative inverse of self
if self
is nonzero.
fn inverse_in_place(&mut self) -> Option<&mut Self>
[src]
fn frobenius_map(&mut self, power: usize)
[src]
Exponentiates this element by a power of the base prime modulus via the Frobenius automorphism.
Provided methods
fn characteristic<'a>() -> &'a [u64]
[src]
Returns the characteristic of the field, in little-endian representation.
fn from_random_bytes(bytes: &[u8]) -> Option<Self>
[src]
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.
#[must_use]fn pow<S: AsRef<[u64]>>(&self, exp: S) -> Self
[src]
Exponentiates this element by a number represented with u64
limbs,
least significant limb first.
fn pow_with_table<S: AsRef<[u64]>>(powers_of_2: &[Self], exp: S) -> Option<Self>
[src]
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.
This returns None
when a power is missing from the table.