Documentation ¶
Overview ¶
Package addchain provides addition chain types and operations on them.
Index ¶
- type Chain
- func (c *Chain) AppendClone(x *big.Int)
- func (c Chain) Clone() Chain
- func (c Chain) End() *big.Int
- func (c Chain) IsAscending() bool
- func (c Chain) Op(k int) (Op, error)
- func (c Chain) Ops(k int) []Op
- func (c Chain) Produces(target *big.Int) error
- func (c Chain) Program() (Program, error)
- func (c Chain) Superset(targets []*big.Int) error
- func (c Chain) Validate() error
- type Op
- type Program
- func (p *Program) Add(i, j int) (int, error)
- func (p Program) Adds() int
- func (p Program) Count() (doubles, adds int)
- func (p Program) Dependencies() []*big.Int
- func (p *Program) Double(i int) (int, error)
- func (p Program) Doubles() int
- func (p Program) Evaluate() Chain
- func (p Program) ReadCounts() []int
- func (p *Program) Shift(i int, s uint) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
Chain is an addition chain.
func Plus ¶
Plus adds x to the addition chain. This is the "o plus" operator defined in [efficientcompaddchain] Section 2.
func Product ¶
Product computes the product of two addition chains. The is the "o times" operator defined in [efficientcompaddchain] Section 2.
func (*Chain) AppendClone ¶
AppendClone appends a copy of x to c.
func (Chain) IsAscending ¶ added in v0.3.0
IsAscending reports whether the chain is ascending, that is if it's in sorted order without repeats, as defined in [knuth] Section 4.6.3 formula (11). Does not fully validate the chain, only that it is ascending.
func (Chain) Ops ¶
Ops returns all operations that produce the kth position. This could be empty for an invalid chain.
type Op ¶
type Op struct{ I, J int }
Op is an instruction to add positions I and J in a chain.
type Program ¶
type Program []Op
Program is a sequence of operations.
func (*Program) Add ¶
Add appends an operation that adds indices i and j. Returns the index of the result.
func (Program) Dependencies ¶
Dependencies returns an array of bitsets where each bitset contains the set of indicies that contributed to that position.
func (*Program) Double ¶
Double appends an operation that doubles index i. Returns the index of the result.
func (Program) ReadCounts ¶
ReadCounts returns how many times each index is read in the program.
Directories ¶
Path | Synopsis |
---|---|
Package acc implements the "addition chain calculator" language: a domain-specific language (DSL) for addition chain computation.
|
Package acc implements the "addition chain calculator" language: a domain-specific language (DSL) for addition chain computation. |
ast
Package ast declares abstract syntax tree types for acc programs.
|
Package ast declares abstract syntax tree types for acc programs. |
ir
Package ir declares an intermediate representation for acc programs.
|
Package ir declares an intermediate representation for acc programs. |
parse
Package parse implements a parser for acc programs.
|
Package parse implements a parser for acc programs. |
pass
Package pass implements analysis and processing passes on acc programs.
|
Package pass implements analysis and processing passes on acc programs. |
printer
Package printer implements printing of acc AST nodes.
|
Package printer implements printing of acc AST nodes. |
Package alg provides base types for addition chain and addition sequence search algorithms.
|
Package alg provides base types for addition chain and addition sequence search algorithms. |
algtest
Package algtest provides algorithm test suites.
|
Package algtest provides algorithm test suites. |
binary
Package binary implements generic binary addition chain algorithms.
|
Package binary implements generic binary addition chain algorithms. |
contfrac
Package contfrac implements addition sequence algorithms based on continued-fraction expansions.
|
Package contfrac implements addition sequence algorithms based on continued-fraction expansions. |
dict
Package dict implements dictionary and run-length addition chain algorithms.
|
Package dict implements dictionary and run-length addition chain algorithms. |
ensemble
Package ensemble provides a collection of addition chain algorithms intended for target integers of cryptographic interest.
|
Package ensemble provides a collection of addition chain algorithms intended for target integers of cryptographic interest. |
exec
Package exec implements addition chain algorithm execution.
|
Package exec implements addition chain algorithm execution. |
heuristic
Package heuristic implements heuristic-based addition sequence algorithms with the Bos-Coster Makesequence structure.
|
Package heuristic implements heuristic-based addition sequence algorithms with the Bos-Coster Makesequence structure. |
opt
Package opt implements generic optimizations that remove redundancy from addition chains.
|
Package opt implements generic optimizations that remove redundancy from addition chains. |
cmd
|
|
addchain
Command addchain generates addition chains.
|
Command addchain generates addition chains. |
internal
|
|
assert
Package assert provides concise functions for common testing assertions.
|
Package assert provides concise functions for common testing assertions. |
bigint
Package bigint provides common functions for manipulating multi-precision integers.
|
Package bigint provides common functions for manipulating multi-precision integers. |
bigints
Package bigints provides helpers for slices of multi-precision integers.
|
Package bigints provides helpers for slices of multi-precision integers. |
bigvector
Package bigvector implements operations on vectors of immutable multi-precision integers.
|
Package bigvector implements operations on vectors of immutable multi-precision integers. |
calc
Package calc evaluates simple arithmetic expressions.
|
Package calc evaluates simple arithmetic expressions. |
cli
Package cli provides utilities for building subcommand-based command line interfaces.
|
Package cli provides utilities for building subcommand-based command line interfaces. |
container/heap
Package heap implements a heap on specific types.
|
Package heap implements a heap on specific types. |
errutil
Package errutil implements common error types and helper functions.
|
Package errutil implements common error types and helper functions. |
gen
Package gen provides templated output generation from addition chain programs.
|
Package gen provides templated output generation from addition chain programs. |
metavars
Package metavars allows manipulation of "meta variables" stored as variable declarations in Go files.
|
Package metavars allows manipulation of "meta variables" stored as variable declarations in Go files. |
polynomial
Package polynomial provides a polynomial type.
|
Package polynomial provides a polynomial type. |
prime
Package prime provides representations of classes of prime numbers.
|
Package prime provides representations of classes of prime numbers. |
print
Package print provides helpers for structured output printing.
|
Package print provides helpers for structured output printing. |
results
Package results stores results of this library on popular cryptographic exponents for testing and documentation purposes.
|
Package results stores results of this library on popular cryptographic exponents for testing and documentation purposes. |
test
Package test provides testing utilities.
|
Package test provides testing utilities. |
zenodo
Package zenodo provides a client for the Zendodo API.
|
Package zenodo provides a client for the Zendodo API. |
Package meta defines properties about this project.
|
Package meta defines properties about this project. |
Package rand provides random addition chain generators.
|
Package rand provides random addition chain generators. |