Trait FieldExt

Source
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;

    // Required methods
    fn from_u128(v: u128) -> Self;
    fn from_bytes_wide(bytes: &[u8; 64]) -> Self;
    fn get_lower_128(&self) -> u128;

    // Provided method
    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§

Source

const MODULUS: &'static str

Modulus of the field written as a string for display purposes

Source

const ROOT_OF_UNITY_INV: Self

Inverse of PrimeField::root_of_unity()

Source

const DELTA: Self

Generator of the $t-order$ multiplicative subgroup

Source

const TWO_INV: Self

Inverse of $2$ in the field.

Source

const ZETA: Self

Element of multiplicative order $3$.

Required Methods§

Source

fn from_u128(v: u128) -> Self

Obtains a field element congruent to the integer v.

Source

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.

Source

fn get_lower_128(&self) -> u128

Gets the lower 128 bits of this field element when expressed canonically.

Provided Methods§

Source

fn pow(&self, by: &[u64; 4]) -> Self

Exponentiates self by by, where by is a little-endian order integer exponent.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl FieldExt for Fp

Source§

const MODULUS: &'static str = "0x40000000000000000000000000000000224698fc094cf91b992d30ed00000001"

Source§

const ROOT_OF_UNITY_INV: Fp

Source§

const DELTA: Fp = DELTA

Source§

const TWO_INV: Fp

Source§

const ZETA: Fp

Source§

impl FieldExt for Fq

Source§

const MODULUS: &'static str = "0x40000000000000000000000000000000224698fc0994a8dd8c46eb2100000001"

Source§

const ROOT_OF_UNITY_INV: Fq

Source§

const DELTA: Fq = DELTA

Source§

const TWO_INV: Fq

Source§

const ZETA: Fq