utils

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyWitness added in v0.5.2

func CopyWitness(to, from frontend.Circuit)

func FromInterface added in v0.6.0

func FromInterface(input interface{}) big.Int

FromInterface converts an interface to a big.Int element

input must be primitive (uintXX, intXX, []byte, string) or implement ToBigIntRegular(res *big.Int) (which is the case for gnark-crypto field elements)

if the input is a string, it calls (big.Int).SetString(input, 0). In particular: The number prefix determines the actual base: A prefix of ”0b” or ”0B” selects base 2, ”0”, ”0o” or ”0O” selects base 8, and ”0x” or ”0X” selects base 16. Otherwise, the selected base is 10 and no prefix is accepted.

panics if the input is invalid

func Parallelize

func Parallelize(nbIterations int, work func(int, int), maxCpus ...int)

Parallelize process in parallel the work function

func ShallowClone added in v0.5.2

func ShallowClone(circuit frontend.Circuit) frontend.Circuit

ShallowClone clones given circuit this is actually a shallow copy --> if the circuits contains maps or slices only the reference is copied.

Types

This section is empty.

Jump to

Keyboard shortcuts

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