fastpoly

package
v0.0.0-...-b1352b5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BatchInterpolate

func BatchInterpolate(polys [][]field.Element, x fr.Element, oncoset ...bool) []field.Element

Batch version of Interpolate

func EvalXnMinusOneOnACoset

func EvalXnMinusOneOnACoset(n, N int) []field.Element

Evaluation x^n - 1 for x on a coset of domain of size N

N is the size of the larger domain
n Is the size of the smaller domain

The result is (in theory) of size N, but it has a periodicity of r = N/n. Thus, we only return the "r" first entries

Largely inspired from gnark's https://github.com/ConsenSys/gnark/blob/8bc13b200cb9aa1ec74e4f4807e2e97fc8d8396f/internal/backend/bls12-377/plonk/prove.go#L734

func Interpolate

func Interpolate(poly []field.Element, x fr.Element, oncoset ...bool) field.Element

Given the evaluations of a polynomial on a domain (whose size must be a power of two, or panic), return an evaluation at a chosen x.

As an input the user can specify that the inputs are given on a coset.

func InterpolateGnark

func InterpolateGnark(api frontend.API, poly []frontend.Variable, x frontend.Variable) frontend.Variable

Evaluate a polynomial in lagrange basis on a gnark circuit

func MultModXMinus1

func MultModXMinus1(domain *fft.Domain, res, a, b []field.Element)

Multiply twi polynomial modulo X^n - 1 a and b must be in coefficient form, the result is in coefficient form a and b are destroyed during the operation

func MultModXnMinus1Precomputed

func MultModXnMinus1Precomputed(domain *fft.Domain, res, a, precomp []field.Element)

Multiply two polynomials modulo X^n - 1 `a` must be in coefficient form `precomp` must be in evaluation form over the domain (DIT) `res` can be either `a` or any pre-allocated array res must pre-allocated in all cases a is destroyed during the operation

func ReEvaluateOnLargerDomainCoset

func ReEvaluateOnLargerDomainCoset(poly []field.Element, newLen int) []field.Element

Given a polynomial in standard order evaluation form. Return the evaluations on a coset of a larger domain. If the factor is not a power of two. The output is a vector of evaluation

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL