multiexp

package module
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2022 License: BSD-3-Clause Imports: 7 Imported by: 2

README

multiExp

Provides exponentation function for big integers with fast speed.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bit1Counter

func Bit1Counter(input Word) uint64

func DoubleExp

func DoubleExp(x, y1, y2, m *big.Int) []*big.Int

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 FourFoldExp

func FourFoldExp(x, m *Int, y []*Int) []*Int

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 FourFoldExpWithPreComputeTableParallel

func FourFoldExpWithPreComputeTableParallel(x, m *Int, y []*Int, pretable *PreTable) []*Int

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! Use at most 4 threads for now. FourFoldExp is not a cryptographically constant-time operation.

func GetWidth

func GetWidth() int

GetWidth returns the width of uint in this system

func StatforInt

func StatforInt(input nat)

Types

type PreTable

type PreTable struct {
	Base      *Int
	Modulos   *Int
	TableSize int
	// contains filtered or unexported fields
}

func PreCompute

func PreCompute(base, modular *Int, tableSize int) *PreTable

Jump to

Keyboard shortcuts

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