poly

package
v0.0.0-...-89ef835 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: ISC Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FFT

func FFT(yPointsIn []*big.Int) []*big.Int

func InverseFFT

func InverseFFT(yPointsIn []*big.Int) []*big.Int

Types

type BatchPoly

type BatchPoly struct {
	// contains filtered or unexported fields
}

Representation of a polynomia.

func (*BatchPoly) Eval

func (poly *BatchPoly) Eval(xPointsIn []*big.Int) []*big.Int

Evaluate the polynomial many times using faster a multi-point evaluation algorithm.

func (*BatchPoly) EvalOnce

func (poly *BatchPoly) EvalOnce(x *big.Int) *big.Int

Evaluate the polynomial at a specified point x.

type BatchPre

type BatchPre struct {
	// contains filtered or unexported fields
}

Precomputated data for interpolating or evaluating a polynomial in a field defined by modulus mod.

func NewBatch

func NewBatch(mod *big.Int, xPointsIn []*big.Int) *BatchPre

Precompute values for interpolating/evaluating a polynomial at the specified x coordinates.

func (*BatchPre) Interp

func (pre *BatchPre) Interp(yPointsIn []*big.Int) *BatchPoly

Interpolate through the y coordinates given, using the pre-specified x-coordinates.

func (*BatchPre) NPoints

func (pre *BatchPre) NPoints() int

func (*BatchPre) NewEvalPoint

func (batchPre *BatchPre) NewEvalPoint(x *big.Int) *PreX

Precompute data necessary to interpolate through fixed points (specified by batchPre) and evaluate at a point x.

type PreX

type PreX struct {
	// contains filtered or unexported fields
}

When we need to interpolate a polynomial through points

(x1, y1),  (x2, y2),  (x3, y3), ...

and the x's are fixed AND we later want to evaluate this polynomial at a fixed point x*, you want this data struct.

func (*PreX) Eval

func (preEval *PreX) Eval(yValues []*big.Int) *big.Int

Run the combined interpolation and evaluation routine.

Jump to

Keyboard shortcuts

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