field

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2022 License: Apache-2.0 Imports: 3 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
	NbWordsIndexesNoLast       []int
	NbWordsIndexesNoZeroNoLast []int
	P20InversionCorrectiveFac  []uint64
	P20InversionNbIterations   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)
	LegendreExponentData       *addchain.AddChainData
	SqrtAtkinExponentData      *addchain.AddChainData
	SqrtSMinusOneOver2Data     *addchain.AddChainData
	SqrtQ3Mod4ExponentData     *addchain.AddChainData
	UseAddChain                bool
}

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

func NewField

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

NewField returns a data structure with needed information 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
addchain
Package addchain is derived from github.com/mmcloughlin/addchain internal packages or examples
Package addchain is derived from github.com/mmcloughlin/addchain internal packages or examples

Jump to

Keyboard shortcuts

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