go_evm384

package module
v0.0.0-...-67eb67e Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

README

go-bn384

Go implementation of addition, subtraction and montgomery multiplication for 384-bit numbers.

Usage

Run the benchmarks go test -bench=.

Documentation

Index

Constants

View Source
const NUM_LIMBS = 6

Variables

This section is empty.

Functions

func Add

func Add(out *Element, x *Element, y *Element)

out <- x + y

func AddMod

func AddMod(out *Element, x *Element, y *Element, mod *Element)

Modular Addition

func LT

func LT(a_hi, a_lo, b_hi, b_lo uint64) bool

return True if a < b, else False

func MulMod

func MulMod(out *Element, x *Element, y *Element, mod *Element, inv uint64)

Montgomery Modular Multiplication: algorithm 14.36, Handbook of Applied Cryptography, http://cacr.uwaterloo.ca/hac/about/chap14.pdf

func Sub

func Sub(out *Element, x *Element, y *Element) uint64

out <- x - y

func SubMod

func SubMod(out *Element, x *Element, y *Element, mod *Element)

Modular Subtraction

Types

type Element

type Element [NUM_LIMBS]uint64

Jump to

Keyboard shortcuts

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