Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Calculator ¶
type Calculator interface { N() int64 // N returns the positive integer that we're reducing by. MultiplyUint64(a uint64, b uint64) uint64 // MultiplyUint64 returns the product (a * b) mod N. MultiplyReducedUint64(a uint64, b uint64) uint64 // MultiplyReducedUint64 returns the product (a * b) mod N. Assumes that a and b are already reduced mod N (otherwise the result is undefined). MultiplyInt64(a int64, b int64) int64 // MultiplyInt64 returns the product (a * b) mod N. MultiplyReducedInt64(a int64, b int64) int64 // MultiplyReducedInt64 returns the product (a * b) mod N. Assumes that a and b are already reduced mod N (otherwise the result is undefined). }
Calculator is the interface satisfied by an object able to perform arithmetic modulo n.
func New ¶
func New(n int64) Calculator
New returns a new calculator for the given value of n. Requires that n is a positive integer, otherwise this will panic.
Click to show internal directories.
Click to hide internal directories.