backend

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package backend implements Zero Knowledge Proof systems: it consumes circuit compiled with gnark/frontend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ID

type ID uint16

ID represent a unique ID for a proving scheme

const (
	UNKNOWN ID = iota
	GROTH16
	PLONK
)

func Implemented

func Implemented() []ID

Implemented return the list of proof systems implemented in gnark

func (ID) String

func (id ID) String() string

String returns the string representation of a proof system

type ProverConfig

type ProverConfig struct {
	Force         bool                      // defaults to false
	HintFunctions map[hint.ID]hint.Function // defaults to all built-in hint functions
	CircuitLogger zerolog.Logger            // defaults to gnark.Logger
}

ProverConfig is the configuration for the prover with the options applied.

func NewProverConfig

func NewProverConfig(opts ...ProverOption) (ProverConfig, error)

NewProverConfig returns a default ProverConfig with given prover options opts applied.

type ProverOption

type ProverOption func(*ProverConfig) error

ProverOption defines option for altering the behaviour of the prover in Prove, ReadAndProve and IsSolved methods. See the descriptions of functions returning instances of this type for implemented options.

func IgnoreSolverError

func IgnoreSolverError() ProverOption

IgnoreSolverError is a prover option that indicates that the Prove algorithm should complete even if constraint system is not solved. In that case, Prove will output an invalid Proof, but will execute all algorithms which is useful for test and benchmarking purposes.

func WithCircuitLogger

func WithCircuitLogger(l zerolog.Logger) ProverOption

WithCircuitLogger is a prover option that specifies zerolog.Logger as a destination for the logs printed by api.Println(). By default, uses gnark/logger. zerolog.Nop() will disable logging

func WithHints

func WithHints(hintFunctions ...hint.Function) ProverOption

WithHints is a prover option that specifies additional hint functions to be used by the constraint solver.

Directories

Path Synopsis
Package groth16 implements Groth16 Zero Knowledge Proof system (aka zkSNARK).
Package groth16 implements Groth16 Zero Knowledge Proof system (aka zkSNARK).
Package hint allows to define computations outside of a circuit.
Package hint allows to define computations outside of a circuit.
Package plonk implements PLONK Zero Knowledge Proof system.
Package plonk implements PLONK Zero Knowledge Proof system.
Package witness provides serialization helpers to encode a witness into a []byte.
Package witness provides serialization helpers to encode a witness into a []byte.

Jump to

Keyboard shortcuts

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