MPCL

Package math

Package math implements various mathematical algorithms and provides commonly used constant values.

Constants

const MaxInt16 = 32767

MaxInt32 is the maximum signed 16-bit integer value.

const MaxInt32 = 2147483647

MaxInt32 is the maximum signed 32-bit integer value.

const MaxInt64 = 9223372036854775807

MaxInt32 is the maximum signed 64-bit integer value.

const MaxInt8 = 127

MaxInt32 is the maximum signed 8-bit integer value.

const MaxUint16 = 65535

MaxUint16 is the maximum unsigned 16-bit integer value.

const MaxUint32 = 4294967295

MaxUint32 is the maximum unsigned 32-bit integer value.

const MaxUint64 = 18446744073709551615

MaxUint64 is the maximum unsigned 64-bit integer value.

const MaxUint8 = 255

MaxUint8 is the maximum unsigned 8-bit integer value.

Variables

This section is empty.

Functions

func DivUint64
func DivUint64(a, b uint64) uint64

DivUint64 divides two unsigned 64-bit integer numbers.

func Exp
func Exp(b, e, m uint) uint

Exp computes modular exponentiation b**e mod |m| (i.e. the sign of m is ignore).

func ExpMontgomery
func ExpMontgomery(b, e, m uint) uint

ExpMontgomery computes modular exponentiation b**e mod |m| (i.e. the sign of m is ignored). The m must be bigger than 0 and not even number.

func MaxUint
func MaxUint(a, b uint) uint

MaxUint returns the maximum of the argument unsigned integer numbers.

func MinUint
func MinUint(a, b uint) uint

MinUint returns the minimum of the argument unsigned integer numbers.

func MulUint64
func MulUint64(a, b uint64) uint64

MulUint64 multiplies two unsigned 64-bit integer numbers.

func SubUint64
func SubUint64(a, b uint64) uint64

SubUint64 subtracts two unsigned 64-bit integer numbers.

Types

This section is empty.