precompute

package
v0.0.0-...-e663500 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeFromTable

func ComputeFromTable(table *PreTable, x, N *big.Int) *big.Int

ComputeFromTable computes g^x mod N with the pre-computation table.

func ComputeFromTableParallel

func ComputeFromTableParallel(table *PreTable, x, N *big.Int) *big.Int

ComputeFromTableParallel computes g^x mod N with the pre-computation table in parallel.

func PrintTable

func PrintTable(p *PreTable)

PrintTable prints out the table for storage

Types

type PreTable

type PreTable struct {
	// contains filtered or unexported fields
}

PreTable only allows to pre-compute a power of 2 for the base g. base[0] should be g and n[0] is 0. base[i] = g^{2^{n[i]}} mod N

func GenPreTable

func GenPreTable(base, N *big.Int, bitLen, tableSize int) *PreTable

GenPreTable generates a precomputation table for RSA accumulators

type Table

type Table struct {
	// contains filtered or unexported fields
}

Table is the precomputing table

func NewTable

func NewTable(g, n, elementUpperBound *big.Int, numElements uint64, byteChunkSize int) *Table

NewTable creates a new precomputing table

func (*Table) Compute

func (t *Table) Compute(x *big.Int, numRoutine int) *big.Int

Compute computes the result of base^x mod n with specified number of goroutines

Jump to

Keyboard shortcuts

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