package
Version:
v0.7.4
Opens a new window with list of versions in this module.
Published: Jun 15, 2024
License: MIT
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
¶
Package field provides modular operations over very high integers.
-
func String2Int(s string) big.Int
-
type Field
-
func (f Field) Add(res, x, y *big.Int)
-
func (f Field) AreEqual(f1, f2 *big.Int) bool
-
func (f Field) BitLen() int
-
func (f Field) Exponent(res, x, n *big.Int) *big.Int
-
func (f Field) Inv(res, x *big.Int)
-
func (f Field) IsEqual(f2 *Field) bool
-
func (f Field) IsZero(e *big.Int) bool
-
func (f Field) Mod(x *big.Int) *big.Int
-
func (f Field) Mul(res, x, y *big.Int)
-
func (f Field) One() *big.Int
-
func (f Field) Order() *big.Int
-
func (f Field) Random(res *big.Int) *big.Int
-
func (f Field) Sub(res, x, y *big.Int) *big.Int
-
func (f Field) Zero() *big.Int
String2Int returns a big.Int representation of the integer s.
Field represents a Galois Field.
NewField returns a newly instantiated field for the given prime order.
Add sets res to x + y modulo the field order.
AreEqual returns whether both elements are equal.
Exponent returns x^n mod field order.
Inv sets res to the modular inverse of x mod field order.
IsEqual returns whether the two fields have the same order.
IsZero returns whether the big.Int is equivalent to zero.
Mod reduces x modulo the field order.
Mul sets res to the multiplication of x and y modulo the field order.
One returns one big.Int of the finite Field.
Order returns the size of the Field.
Random sets res to a random big.Int in the Field.
Sub sets res to x - y modulo the field order.
Zero returns the zero big.Int of the finite Field.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.