fft

package
v0.0.0-...-5aea771 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPolyEqual

func IsPolyEqual(a []gmcl.Fr, b []gmcl.Fr) bool

Returns true if polynomial A is a equal to polynomial B.

func IsPolyZero

func IsPolyZero(a []gmcl.Fr) bool

Returns true if polynomial A is a zero polynomial.

func PolyAdd

func PolyAdd(a []gmcl.Fr, b []gmcl.Fr) []gmcl.Fr

Computes the standard polynomial addition, polynomial A + polynomial B, and stores result in polynomial C.

func PolyCondense

func PolyCondense(a []gmcl.Fr) []gmcl.Fr

Removes extraneous zero entries from in vector representation of polynomial. Example - Degree-4 Polynomial: [0, 1, 2, 3, 4, 0, 0, 0, 0] -> [0, 1, 2, 3, 4] Note: Simplest condensed form is a zero polynomial of vector form: [0]

func PolyDiv

func PolyDiv(A []gmcl.Fr, B []gmcl.Fr) ([]gmcl.Fr, []gmcl.Fr)

Computes q(x) and r(x) s.t. a(x) = q(x) * b(x) + r(x)

func PolyLongDiv

func PolyLongDiv(A []gmcl.Fr, B []gmcl.Fr) []gmcl.Fr

Long polynomial division for two polynomials in coefficient form Need to check divide by zero

func PolyMul

func PolyMul(a []gmcl.Fr, b []gmcl.Fr) []gmcl.Fr

Compute a(x) * b(x)

func PolySub

func PolySub(a []gmcl.Fr, b []gmcl.Fr) []gmcl.Fr

Computes the standard polynomial subtraction, polynomial A - polynomial B, and stores result in polynomial C.

func ReverseBitOrderFr

func ReverseBitOrderFr(values []gmcl.Fr)

rearrange Fr elements in reverse bit order. Supports 2**31 max element count.

func ReverseBitOrderFrPtr

func ReverseBitOrderFrPtr(values []*gmcl.Fr)

rearrange Fr ptr elements in reverse bit order. Supports 2**31 max element count.

func ReverseBitsLimited

func ReverseBitsLimited(length uint32, value uint32) uint32

Types

type FFTSettings

type FFTSettings struct {
	MaxWidth uint64
	// the generator used to get all roots of unity
	RootOfUnity *gmcl.Fr
	// domain, starting and ending with 1 (duplicate!)
	ExpandedRootsOfUnity []gmcl.Fr
	// reverse domain, same as inverse values of domain. Also starting and ending with 1.
	ReverseRootsOfUnity []gmcl.Fr
}

func NewFFTSettings

func NewFFTSettings(maxScale uint8) *FFTSettings

func (*FFTSettings) FFT

func (fs *FFTSettings) FFT(vals []gmcl.Fr, inv bool) ([]gmcl.Fr, error)

func (*FFTSettings) InplaceFFT

func (fs *FFTSettings) InplaceFFT(vals []gmcl.Fr, out []gmcl.Fr, inv bool) error

Jump to

Keyboard shortcuts

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