ark_test_curves

Trait FftField

Source
pub trait FftField: Field {
    const GENERATOR: Self;
    const TWO_ADICITY: u32;
    const TWO_ADIC_ROOT_OF_UNITY: Self;
    const SMALL_SUBGROUP_BASE: Option<u32> = None;
    const SMALL_SUBGROUP_BASE_ADICITY: Option<u32> = None;
    const LARGE_SUBGROUP_ROOT_OF_UNITY: Option<Self> = None;

    // Provided method
    fn get_root_of_unity(n: u64) -> Option<Self> { ... }
}
Expand description

The interface for fields that are able to be used in FFTs.

Required Associated Constants§

Source

const GENERATOR: Self

The generator of the multiplicative group of the field

Source

const TWO_ADICITY: u32

Let N be the size of the multiplicative group defined by the field. Then TWO_ADICITY is the two-adicity of N, i.e. the integer s such that N = 2^s * t for some odd integer t.

Source

const TWO_ADIC_ROOT_OF_UNITY: Self

2^s root of unity computed by GENERATOR^t

Provided Associated Constants§

Source

const SMALL_SUBGROUP_BASE: Option<u32> = None

An integer b such that there exists a multiplicative subgroup of size b^k for some integer k.

Source

const SMALL_SUBGROUP_BASE_ADICITY: Option<u32> = None

The integer k such that there exists a multiplicative subgroup of size Self::SMALL_SUBGROUP_BASE^k.

Source

const LARGE_SUBGROUP_ROOT_OF_UNITY: Option<Self> = None

GENERATOR^((MODULUS-1) / (2^s * SMALL_SUBGROUP_BASE^SMALL_SUBGROUP_BASE_ADICITY)) Used for mixed-radix FFT.

Provided Methods§

Source

fn get_root_of_unity(n: u64) -> Option<Self>

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 FftConfig::LARGE_SUBGROUP_ROOT_OF_UNITY (for n = 2^i * FftConfig::SMALL_SUBGROUP_BASE^j for some i, j).

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<P> FftField for CubicExtField<P>

Source§

const GENERATOR: CubicExtField<P> = _

Source§

const TWO_ADICITY: u32 = <P::BaseField>::TWO_ADICITY

Source§

const TWO_ADIC_ROOT_OF_UNITY: CubicExtField<P> = _

Source§

const SMALL_SUBGROUP_BASE: Option<u32> = <P::BaseField>::SMALL_SUBGROUP_BASE

Source§

const SMALL_SUBGROUP_BASE_ADICITY: Option<u32> = <P::BaseField>::SMALL_SUBGROUP_BASE_ADICITY

Source§

const LARGE_SUBGROUP_ROOT_OF_UNITY: Option<CubicExtField<P>> = _

Source§

impl<P> FftField for QuadExtField<P>

Source§

const GENERATOR: QuadExtField<P> = _

Source§

const TWO_ADICITY: u32 = <P::BaseField>::TWO_ADICITY

Source§

const TWO_ADIC_ROOT_OF_UNITY: QuadExtField<P> = _

Source§

const SMALL_SUBGROUP_BASE: Option<u32> = <P::BaseField>::SMALL_SUBGROUP_BASE

Source§

const SMALL_SUBGROUP_BASE_ADICITY: Option<u32> = <P::BaseField>::SMALL_SUBGROUP_BASE_ADICITY

Source§

const LARGE_SUBGROUP_ROOT_OF_UNITY: Option<QuadExtField<P>> = _

Source§

impl<P, const N: usize> FftField for Fp<P, N>
where P: FpConfig<N>,

Source§

const GENERATOR: Fp<P, N> = P::GENERATOR

Source§

const TWO_ADICITY: u32 = P::TWO_ADICITY

Source§

const TWO_ADIC_ROOT_OF_UNITY: Fp<P, N> = P::TWO_ADIC_ROOT_OF_UNITY

Source§

const SMALL_SUBGROUP_BASE: Option<u32> = P::SMALL_SUBGROUP_BASE

Source§

const SMALL_SUBGROUP_BASE_ADICITY: Option<u32> = P::SMALL_SUBGROUP_BASE_ADICITY

Source§

const LARGE_SUBGROUP_ROOT_OF_UNITY: Option<Fp<P, N>> = P::LARGE_SUBGROUP_ROOT_OF_UNITY