field

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package field provides Golang code generation for efficient field arithmetic operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	PackageName          string
	ElementName          string
	ModulusBig           *big.Int
	Modulus              string
	ModulusHex           string
	NbWords              int
	NbBits               int
	NbWordsLastIndex     int
	NbWordsIndexesNoZero []int
	NbWordsIndexesFull   []int
	Q                    []uint64
	QInverse             []uint64
	QMinusOneHalvedP     []uint64 // ((q-1) / 2 ) + 1
	ASM                  bool
	RSquare              []uint64
	One                  []uint64
	LegendreExponent     string // big.Int to base16 string
	NoCarry              bool
	NoCarrySquare        bool // used if NoCarry is set, but some op may overflow in square optimization
	SqrtQ3Mod4           bool
	SqrtAtkin            bool
	SqrtTonelliShanks    bool
	SqrtE                uint64
	SqrtS                []uint64
	SqrtAtkinExponent    string   // big.Int to base16 string
	SqrtSMinusOneOver2   string   // big.Int to base16 string
	SqrtQ3Mod4Exponent   string   // big.Int to base16 string
	SqrtG                []uint64 // NonResidue ^  SqrtR (montgomery form)

	NonResidue []uint64 // (montgomery form)
}

Field precomputed values used in template for code generation of field element APIs

func NewField

func NewField(packageName, elementName, modulus string) (*Field, error)

NewField returns a data structure with needed informations to generate apis for field element

See field/generator package

Directories

Path Synopsis
asm
amd64
Package amd64 contains syntactic sugar to generate amd64 assembly code
Package amd64 contains syntactic sugar to generate amd64 assembly code
internal

Jump to

Keyboard shortcuts

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