gkr

package
v0.0.0-...-ae8e47d Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RegisteredGates = map[string]Gate{
	"identity": IdentityGate{},
	"add":      AddGate{},
	"mul":      MulGate{},
	"mimc":     MiMCCipherGate{Ark: 0},
}

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(api frontend.API, 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 AddGate

type AddGate struct{}

func (AddGate) Degree

func (a AddGate) Degree() int

func (AddGate) Evaluate

func (a AddGate) Evaluate(api frontend.API, v ...frontend.Variable) frontend.Variable

type Circuit

type Circuit []Wire

type Gate

type Gate interface {
	Evaluate(frontend.API, ...frontend.Variable) frontend.Variable
	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(_ frontend.API, input ...frontend.Variable) frontend.Variable

type MiMCCipherGate

type MiMCCipherGate struct {
	Ark frontend.Variable
}

func (MiMCCipherGate) Degree

func (m MiMCCipherGate) Degree() int

func (MiMCCipherGate) Evaluate

func (m MiMCCipherGate) Evaluate(api frontend.API, input ...frontend.Variable) frontend.Variable

type MulGate

type MulGate struct{}

func (MulGate) Degree

func (g MulGate) Degree() int

TODO: Degree must take nbInputs as an argument and return degree = nbInputs

func (MulGate) Evaluate

func (g MulGate) Evaluate(api frontend.API, x ...frontend.Variable) frontend.Variable

type Option

type Option func(*settings)

func WithSortedCircuit

func WithSortedCircuit(sorted []*Wire) Option

type Proof

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

func DeserializeProof

func DeserializeProof(sorted []*Wire, serializedProof []frontend.Variable) (Proof, error)

func (Proof) Serialize

func (p Proof) Serialize() []frontend.Variable

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) 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