Documentation ¶
Index ¶
- func DoubleExp(x *big.Int, y2 [2]*big.Int, m *big.Int) [2]*big.Int
- func ExpParallel(x, y, m *big.Int, preTable *PreTable, numRoutine, wordChunkSize int) *big.Int
- func FourfoldExp(x, m *big.Int, y4 [4]*big.Int) [4]*big.Int
- func FourfoldExpPrecomputed(x, m *big.Int, y4 [4]*big.Int, preTable *PreTable) [4]*big.Int
- func FourfoldExpPrecomputedParallel(x, m *big.Int, y4 [4]*big.Int, preTable *PreTable) [4]*big.Int
- func GetTableSize(table *PreTable)
- type PreTable
- type Word
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoubleExp ¶
DoubleExp sets z1 = x**y1 mod |m|, z2 = x**y2 mod |m| ... (i.e. the sign of m is ignored), and returns z1, z2. If m == nil or m == 0, z = x**y unless y <= 0 then z = 1. If m != 0, y < 0, and x and m are not relatively prime, z is unchanged and nil is returned.
DoubleExp is not a cryptographically constant-time operation.
func ExpParallel ¶ added in v0.0.4
ExpParallel computes x ** y mod |m| utilizing multiple CPU cores numRoutine specifies the number of routine for computing the result
func FourfoldExp ¶ added in v0.0.4
FourfoldExp sets z1 = x**y1 mod |m|, z2 = x**y2 mod |m| ... (i.e. the sign of m is ignored), and returns z1, z2... In construction, many panic conditions. Use at your own risk!
FourfoldExp is not a cryptographically constant-time operation.
func FourfoldExpPrecomputed ¶ added in v0.0.5
FourfoldExpPrecomputed sets z1 = x**y1 mod |m|, z2 = x**y2 mod |m| ... (i.e. the sign of m is ignored), and returns z1, z2... In construction, many panic conditions. Use at your own risk! Use single thread FourfoldExpPrecomputed is not a cryptographically constant-time operation.
func FourfoldExpPrecomputedParallel ¶ added in v0.0.4
FourfoldExpPrecomputedParallel sets z1 = x**y1 mod |m|, z2 = x**y2 mod |m| ... (i.e. the sign of m is ignored), and returns z1, z2... In construction, many panic conditions. Use at your own risk! Use at most 4 threads for now. FourfoldExpPrecomputedParallel is not a cryptographically constant-time operation.
func GetTableSize ¶ added in v0.1.0
func GetTableSize(table *PreTable)