limbs

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decompose

func Decompose(input *big.Int, nbBits uint, res []*big.Int) error

Decompose decomposes the input into res as integers of width nbBits. It errors if the decomposition does not fit into res or if res is uninitialized.

The following holds

input = \sum_{i=0}^{len(res)} res[i] * 2^{nbBits * i}

func Recompose

func Recompose(inputs []*big.Int, nbBits uint, res *big.Int) error

Recompose takes the limbs in inputs and combines them into res. It errors if inputs is uninitialized or zero-length and if the result is uninitialized.

The following holds

res = \sum_{i=0}^{len(inputs)} inputs[i] * 2^{nbBits * i}

Types

This section is empty.

Jump to

Keyboard shortcuts

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