Trait halo2_proofs::arithmetic::FieldExt
[−]pub trait FieldExt: SqrtRatio + From<bool> + Ord + Group<Scalar = Self> {
const MODULUS: &'static str;
const ROOT_OF_UNITY_INV: Self;
const DELTA: Self;
const TWO_INV: Self;
const ZETA: Self;
fn from_u128(v: u128) -> Self;
fn from_bytes_wide(bytes: &[u8; 64]) -> Self;
fn get_lower_128(&self) -> u128;
fn pow(&self, by: &[u64; 4]) -> Self { ... }
}
Expand description
This trait is a common interface for dealing with elements of a finite field.
Required Associated Constants
const ROOT_OF_UNITY_INV: Self
const ROOT_OF_UNITY_INV: Self
Inverse of PrimeField::root_of_unity()
const DELTA: Self
const DELTA: Self
Generator of the $t-order$ multiplicative subgroup
const TWO_INV: Self
const TWO_INV: Self
Inverse of $2$ in the field.
const ZETA: Self
const ZETA: Self
Element of multiplicative order $3$.
Required Methods
fn from_bytes_wide(bytes: &[u8; 64]) -> Self
fn from_bytes_wide(bytes: &[u8; 64]) -> Self
Obtains a field element that is congruent to the provided little endian byte representation of an integer.
fn get_lower_128(&self) -> u128
fn get_lower_128(&self) -> u128
Gets the lower 128 bits of this field element when expressed canonically.
Provided Methods
Implementations on Foreign Types
sourceimpl FieldExt for Fp
impl FieldExt for Fp
sourcefn from_bytes_wide(bytes: &[u8; 64]) -> Fp
fn from_bytes_wide(bytes: &[u8; 64]) -> Fp
Converts a 512-bit little endian integer into
a $field
by reducing by the modulus.
const MODULUS: &'static str = MODULUS_STR
const TWO_INV: Fp = TWO_INV
const ROOT_OF_UNITY_INV: Fp = ROOT_OF_UNITY_INV
const DELTA: Fp = DELTA
const ZETA: Fp = ZETA
fn from_u128(v: u128) -> Fp
fn get_lower_128(&self) -> u128
sourceimpl FieldExt for Fq
impl FieldExt for Fq
sourcefn from_bytes_wide(bytes: &[u8; 64]) -> Fq
fn from_bytes_wide(bytes: &[u8; 64]) -> Fq
Converts a 512-bit little endian integer into
a $field
by reducing by the modulus.
const MODULUS: &'static str = MODULUS_STR
const TWO_INV: Fq = TWO_INV
const ROOT_OF_UNITY_INV: Fq = ROOT_OF_UNITY_INV
const DELTA: Fq = DELTA
const ZETA: Fq = ZETA
fn from_u128(v: u128) -> Fq
fn get_lower_128(&self) -> u128
sourceimpl FieldExt for Fr
impl FieldExt for Fr
sourcefn from_bytes_wide(bytes: &[u8; 64]) -> Fr
fn from_bytes_wide(bytes: &[u8; 64]) -> Fr
Converts a 512-bit little endian integer into
a $field
by reducing by the modulus.
const MODULUS: &'static str = MODULUS_STR
const TWO_INV: Fr = TWO_INV
const ROOT_OF_UNITY_INV: Fr = ROOT_OF_UNITY_INV
const DELTA: Fr = DELTA
const ZETA: Fr = ZETA
fn from_u128(v: u128) -> Fr
fn get_lower_128(&self) -> u128
sourceimpl FieldExt for Fq
impl FieldExt for Fq
sourcefn from_bytes_wide(bytes: &[u8; 64]) -> Fq
fn from_bytes_wide(bytes: &[u8; 64]) -> Fq
Converts a 512-bit little endian integer into
a $field
by reducing by the modulus.
const MODULUS: &'static str = MODULUS_STR
const TWO_INV: Fq = TWO_INV
const ROOT_OF_UNITY_INV: Fq = ROOT_OF_UNITY_INV
const DELTA: Fq = DELTA
const ZETA: Fq = ZETA
fn from_u128(v: u128) -> Fq
fn get_lower_128(&self) -> u128
sourceimpl FieldExt for Fq2
impl FieldExt for Fq2
sourcefn from_bytes_wide(bytes: &[u8; 64]) -> Fq2
fn from_bytes_wide(bytes: &[u8; 64]) -> Fq2
Converts a 512-bit little endian integer into
a Fq
by reducing by the modulus.