unsafekzg

package
v0.0.0-...-4c0a751 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Overview

Package unsafekzg is a convenience package (to be use for test purposes only) to generate and cache SRS for the kzg scheme (and indirectly for PlonK setup).

Functions in this package are thread safe.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSRS

func NewSRS(ccs constraint.ConstraintSystem, opts ...Option) (canonical kzg.SRS, lagrange kzg.SRS, err error)

NewSRS returns a pair of kzg.SRS; one in canonical form, the other in Lagrange form. Default options use a memory cache, see Option for more details & options.

Types

type Option

type Option func(*config) error

Option allows changing the behaviour of the unsafe KZG SRS generation.

func WithCacheDir

func WithCacheDir(dir string) Option

WithCacheDir enables the filesystem cache and sets the cache directory to the provided path.

func WithFSCache

func WithFSCache() Option

WithCacheDir enables the filesystem cache and sets the cache directory to ~/.gnark/kzg by default.

func WithToxicSeed

func WithToxicSeed(seed []byte) Option

WithToxicSeed sets the toxic value to the sha256 hash of the provided seed.

NB! This is a debug option and should not be used in production.

func WithToxicValue

func WithToxicValue(toxicValue *big.Int) Option

WithToxicValue sets the toxic value to the provided value.

NB! This is a debug option and should not be used in production.

Jump to

Keyboard shortcuts

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