modular

package
v0.0.0-...-a4a72b7 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorIntOverflow = errors.New("integer overflow")

ErrorIntOverflow For asserting that the values do not overflow in Int64

View Source
var ErrorInverse = errors.New("no Modular Inverse exists")
View Source
var ErrorNegativeExponent = errors.New("negative Exponent provided")

ErrorNegativeExponent for asserting that the exponent we receive is positive

Functions

func Exponentiation

func Exponentiation(base, exponent, mod int64) (int64, error)

Exponentiation returns base^exponent % mod

func Inverse

func Inverse(a, m int64) (int64, error)

Inverse Modular function

func Multiply64BitInt

func Multiply64BitInt(left, right int64) (int64, error)

Multiply64BitInt Checking if the integer multiplication overflows

Types

This section is empty.

Jump to

Keyboard shortcuts

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