fp

package
v0.0.0-...-3948e75 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder interface {
	Properties

	// Add generates code to add y into x modulo p.
	//	x ≡ x + y (mod p)
	Add(x, y mp.Int)

	// Sub generates code to subtract y from x modulo p.
	//	x ≡ x - y (mod p)
	Sub(x, y mp.Int)

	// ReduceDouble computes z congruent to x modulo p. Let the element size be 2ˡ.
	// This function assumes x < 2²ˡ and produces z < 2ˡ. Note that z is not
	// guaranteed to be less than p.
	ReduceDouble(z, x mp.Int)
}

type Field

type Field interface {
	Properties

	Build(*build.Context) Builder
}

type Properties

type Properties interface {
	// Prime returns the field modulus.
	Prime() *big.Int

	// ElementBits returns the number of bits used to represent a field element.
	// This will be larger than the size of the prime if it's not on a word boundary.
	ElementBits() int

	// ElementSize returns the number of bytes used to represent a field element.
	ElementSize() int

	// Limbs returns the number of 64-bit limbs required for a field element.
	Limbs() int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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