gkr

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: May 2, 2023 License: Apache-2.0 Imports: 10 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChallengeNames

func ChallengeNames(sorted []*Wire, logNbInstances int, prefix string) []string

func ProofSize

func ProofSize(c Circuit, logNbInstances int) int

ProofSize computes how large the proof for a circuit would be. It needs nbUniqueOutputs to be set

func Verify

func Verify(c Circuit, assignment WireAssignment, proof Proof, transcriptSettings fiatshamir.Settings, options ...Option) error

Verify the consistency of the claimed output with the claimed input Unlike in Prove, the assignment argument need not be complete

Types

type Circuit

type Circuit []Wire

func (Circuit) MemoryRequirements added in v0.9.1

func (c Circuit) MemoryRequirements(nbInstances int) []int

MemoryRequirements returns an increasing vector of memory allocation sizes required for proving a GKR statement

type Gate

type Gate interface {
	Evaluate(...fr.Element) fr.Element
	Degree() int
}

Gate must be a low-degree polynomial

type IdentityGate

type IdentityGate struct{}

func (IdentityGate) Degree

func (IdentityGate) Degree() int

func (IdentityGate) Evaluate

func (IdentityGate) Evaluate(input ...fr.Element) fr.Element

type Option

type Option func(*settings)

func WithPool

func WithPool(pool *polynomial.Pool) Option

func WithSortedCircuit

func WithSortedCircuit(sorted []*Wire) Option

func WithWorkers added in v0.9.1

func WithWorkers(workers *utils.WorkerPool) Option

type Proof

type Proof []sumcheck.Proof // for each layer, for each wire, a sumcheck (for each variable, a polynomial)

func Prove

func Prove(c Circuit, assignment WireAssignment, transcriptSettings fiatshamir.Settings, options ...Option) (Proof, error)

Prove consistency of the claimed assignment

func (Proof) SerializeToBigInts added in v0.9.1

func (p Proof) SerializeToBigInts(outs []*big.Int)

SerializeToBigInts flattens a proof object into the given slice of big.Ints useful in gnark hints. TODO: Change propagation: Once this is merged, it will duplicate some code in std/gkr/bn254Prover.go. Remove that in favor of this

type Wire

type Wire struct {
	Gate   Gate
	Inputs []*Wire // if there are no Inputs, the wire is assumed an input wire
	// contains filtered or unexported fields
}

func (Wire) IsInput

func (w Wire) IsInput() bool

func (Wire) IsOutput

func (w Wire) IsOutput() bool

func (Wire) NbClaims

func (w Wire) NbClaims() int

type WireAssignment

type WireAssignment map[*Wire]polynomial.MultiLin

WireAssignment is assignment of values to the same wire across many instances of the circuit

func (WireAssignment) Complete

func (a WireAssignment) Complete(c Circuit) WireAssignment

Complete the circuit evaluation from input values

func (WireAssignment) NumInstances

func (a WireAssignment) NumInstances() int

func (WireAssignment) NumVars

func (a WireAssignment) NumVars() int

Jump to

Keyboard shortcuts

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