fr

package
v0.0.0-...-95aab37 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const INV uint64 = 0x1ba3a358ef788ef9

INV = -(r^{-1} mod 2^64) mod 2^64

View Source
const MODULUS_BITS uint32 = 252
View Source
const NUM_BITS uint32 = MODULUS_BITS

Variables

View Source
var MODULUS = Fr{
	0xd097_0e5e_d6f7_2cb7,
	0xa668_2093_ccc8_1082,
	0x0667_3b01_0134_3b00,
	0x0e7d_b4ea_6533_afa9,
}
View Source
var R = Fr{
	0x25f8_0bb3_b996_07d9,
	0xf315_d62f_66b6_e750,
	0x9325_14ee_eb88_14f4,
	0x09a6_fc6f_4791_55c6,
}

/ R = 2^256 mod r

View Source
var R2 = Fr{
	0x67719aa495e57731,
	0x51b0cef09ce3fc26,
	0x69dab7fac026e9a5,
	0x04f6547b8d127688,
}

/ R^2 = 2^512 mod r

View Source
var R3 = Fr{
	0xe0d6c6563d830544,
	0x323e3883598d0f85,
	0xf0fea3004c2e2ba8,
	0x05874f84946737ec,
}

/ R^3 = 2^768 mod r

Functions

This section is empty.

Types

type Fr

type Fr [4]uint64

func FromBytes

func FromBytes(byt []byte) *Fr

func FromBytesWide

func FromBytesWide(byt []byte) *Fr

func MontRed

func MontRed(r0, r1, r2, r3, r4, r5, r6, r7 uint64) *Fr

func One

func One() *Fr

func Zero

func Zero() *Fr

func (*Fr) Add

func (lhs *Fr) Add(rhs *Fr) *Fr

func (*Fr) Bytes

func (f *Fr) Bytes() []byte

IntoBytes converts f into a little endian byte slice

func (*Fr) Double

func (f *Fr) Double() *Fr

func (*Fr) Mul

func (lhs *Fr) Mul(rhs *Fr) *Fr

Mul mutiplies two field elements together

func (*Fr) Neg

func (f *Fr) Neg() *Fr

func (*Fr) String

func (f *Fr) String() string

func (*Fr) Sub

func (lhs *Fr) Sub(rhs *Fr) *Fr

Sub Subtracts one field from another

Jump to

Keyboard shortcuts

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