gkr

package
Version: v0.0.0-...-95bb966 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInitialQPrimeAndQ

func GetInitialQPrimeAndQ(bN, bG int) ([]fr.Element, []fr.Element)

GetInitialQPrimeAndQ returns the initial randomness of the protocol

Types

type Proof

type Proof struct {
	SumcheckProofs []sumcheck.Proof
	ClaimsLeft     []fr.Element
	ClaimsRight    []fr.Element
}

Proof contains all the data for a GKR to be verified

type Prover

type Prover struct {
	// contains filtered or unexported fields
}

Prover contains all relevant data for a GKR prover

func NewProver

func NewProver(circuit circuit.Circuit, assignment circuit.Assignment) Prover

NewProver returns a new prover

func (*Prover) GetBookKeepingTablesForInitialRound

func (p *Prover) GetBookKeepingTablesForInitialRound(
	qPrime, q []fr.Element, nCore int,
) (
	vL, vR, eq []polynomial.BookKeepingTable,
	statics []polynomial.BookKeepingTable,
)

GetBookKeepingTablesForInitialRound generates and prefold the book-keeping tables for a the initial GKR round

func (*Prover) GetBookKeepingTablesForIntermediateRound

func (p *Prover) GetBookKeepingTablesForIntermediateRound(
	layer int,
	qPrime, qL, qR []fr.Element,
	lambdaL, lambdaR fr.Element,
	nCore int,
) (
	vL, vR, eq []polynomial.BookKeepingTable,
	statics []polynomial.BookKeepingTable,
)

GetBookKeepingTablesForIntermediateRound generates and prefold the book-keeping tables for an intermediate round

func (*Prover) InitialRoundSumcheckProver

func (p *Prover) InitialRoundSumcheckProver(qPrime []fr.Element, q []fr.Element, nCore int) sumcheck.MultiThreadedProver

InitialRoundSumcheckProver returns a prover object for the initial round

func (*Prover) IntermediateRoundsSumcheckProver

func (p *Prover) IntermediateRoundsSumcheckProver(
	layer int,
	qPrime, qL, qR []fr.Element,
	lambdaL, lambdaR fr.Element,
	nCore int,
) sumcheck.MultiThreadedProver

IntermediateRoundsSumcheckProver returns a prover object for the intermediate round

func (*Prover) Prove

func (p *Prover) Prove(nCore int) Proof

Prove produces a GKR proof

type Verifier

type Verifier struct {
	// contains filtered or unexported fields
}

Verifier contains all the data relevant for the verifier algorithm of GKR

func NewVerifier

func NewVerifier(bN int, circuit circuit.Circuit) Verifier

NewVerifier constructs a new verifier object

func (*Verifier) Verify

func (v *Verifier) Verify(
	proof Proof,
	inputs, outputs [][]fr.Element,
) bool

Verify returns true if the GKR proof is valid

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL