modm

package
v0.1.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	//BitsPerLimb 30limb for bignum256modm
	BitsPerLimb = 30

	//LimbSize every limb size in bignum256modm
	LimbSize = 9
)

Variables

This section is empty.

Functions

func Add

func Add(r, x, y *Bignum256)

Add r = x + y

func Contract

func Contract(out []byte, in *Bignum256)

Contract contract a bignum256 to bytes

func ContractSlidingWindow

func ContractSlidingWindow(r *[256]int8, s *Bignum256, windowSize uint)

ContractSlidingWindow contract a bignum256 in a slide window

func ContractWindow4

func ContractWindow4(r *[64]int8, in *Bignum256)

ContractWindow4 contract in window

func Expand

func Expand(out *Bignum256, in []byte)

Expand expand bignum256 from bytes

func ExpandRaw

func ExpandRaw(out *Bignum256, in *[32]byte)

ExpandRaw not reduce

func IsAtMost128bitsVartime

func IsAtMost128bitsVartime(a *Bignum256) bool

IsAtMost128bitsVartime 128bits is zero

func IsOneVartime

func IsOneVartime(a *Bignum256) bool

IsOneVartime a == 1

func IsZeroVartime

func IsZeroVartime(a *Bignum256) bool

IsZeroVartime a == 0

func LessThanOrEqualVartime

func LessThanOrEqualVartime(a, b *Bignum256, limbSize int) bool

LessThanOrEqualVartime if a<= b

func LessThanVartime

func LessThanVartime(a, b *Bignum256, limbSize int) bool

LessThanVartime if a< b

func Mul

func Mul(r, x, y *Bignum256)

Mul r = x*y

func MulAdd

func MulAdd(s, a, b, c *Bignum256)

MulAdd s = a*b + c

func SubVartime

func SubVartime(out, a, b *Bignum256, limbSize int)

SubVartime out = a -b

Types

type Bignum256

type Bignum256 [9]Element

Bignum256 in 32bit

func (*Bignum256) Reset

func (r *Bignum256) Reset()

Reset set zero

type Element

type Element uint32

Element is uint32

Jump to

Keyboard shortcuts

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