binius_ntt

Trait AdditiveNTT

source
pub trait AdditiveNTT<P: PackedField> {
    // Required methods
    fn log_domain_size(&self) -> usize;
    fn get_subspace_eval(&self, i: usize, j: usize) -> P::Scalar;
    fn forward_transform(
        &self,
        data: &mut [P],
        coset: u32,
        log_batch_size: usize,
    ) -> Result<(), Error>;
    fn inverse_transform(
        &self,
        data: &mut [P],
        coset: u32,
        log_batch_size: usize,
    ) -> Result<(), Error>;

    // Provided methods
    fn forward_transform_ext<PE>(
        &self,
        data: &mut [PE],
        coset: u32,
    ) -> Result<(), Error>
       where PE: RepackedExtension<P>,
             PE::Scalar: ExtensionField<P::Scalar> { ... }
    fn inverse_transform_ext<PE>(
        &self,
        data: &mut [PE],
        coset: u32,
    ) -> Result<(), Error>
       where PE: RepackedExtension<P>,
             PE::Scalar: ExtensionField<P::Scalar> { ... }
}
Expand description

The additive NTT defined defined in LCH14.

Required Methods§

source

fn log_domain_size(&self) -> usize

Base-2 logarithm of the size of the NTT domain.

source

fn get_subspace_eval(&self, i: usize, j: usize) -> P::Scalar

Get the normalized subspace polynomial evaluation $\hat{W}_i(\beta_j)$.

§Preconditions
  • i must be less than self.log_domain_size()
  • j must be less than self.log_domain_size() - i
source

fn forward_transform( &self, data: &mut [P], coset: u32, log_batch_size: usize, ) -> Result<(), Error>

Forward transformation defined in LCH14 on a batch of inputs.

Input is the vector of polynomial coefficients in novel basis, output is in Lagrange basis. The batched inputs are interleaved, which improves the cache-efficiency of the computation.

source

fn inverse_transform( &self, data: &mut [P], coset: u32, log_batch_size: usize, ) -> Result<(), Error>

Inverse transformation defined in LCH14 on a batch of inputs.

Input is the vector of polynomial coefficients in Lagrange basis, output is in novel basis. The batched inputs are interleaved, which improves the cache-efficiency of the computation.

Provided Methods§

source

fn forward_transform_ext<PE>( &self, data: &mut [PE], coset: u32, ) -> Result<(), Error>

source

fn inverse_transform_ext<PE>( &self, data: &mut [PE], coset: u32, ) -> Result<(), Error>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<F, P> AdditiveNTT<P> for DynamicDispatchNTT<F>
where F: BinaryField, P: PackedField<Scalar = F>,

source§

impl<F, TA, P> AdditiveNTT<P> for MultithreadedNTT<F, TA>
where F: BinaryField, TA: TwiddleAccess<F> + Sync, P: PackedField<Scalar = F>,

source§

impl<F, TA, P> AdditiveNTT<P> for SingleThreadedNTT<F, TA>
where F: BinaryField, TA: TwiddleAccess<F>, P: PackedField<Scalar = F>,