plonk

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 20 Imported by: 29

Documentation

Overview

Package plonk implements PLONK Zero Knowledge Proof system.

See also

https://eprint.iacr.org/2019/953

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSolved

func IsSolved(sparseR1cs frontend.CompiledConstraintSystem, witness frontend.Circuit) error

IsSolved attempts to solve the constraint system with provided witness returns nil if it succeeds, error otherwise.

func Verify

func Verify(proof Proof, publicData PublicData, publicWitness frontend.Circuit) error

Verify verifies a PLONK proof, from the proof, preprocessed public data, and public witness.

Types

type Assert

type Assert struct {
	*require.Assertions
}

Assert is a helper to test circuits

func NewAssert

func NewAssert(t *testing.T) *Assert

NewAssert returns an Assert helper

func (*Assert) ProverFailed

func (assert *Assert) ProverFailed(sparseR1cs frontend.CompiledConstraintSystem, witness frontend.Circuit)

func (*Assert) ProverSucceeded

func (assert *Assert) ProverSucceeded(sparseR1cs frontend.CompiledConstraintSystem, witness frontend.Circuit)

func (*Assert) SolvingFailed

func (assert *Assert) SolvingFailed(sparseR1cs frontend.CompiledConstraintSystem, witness frontend.Circuit)

SolvingFailed Verifies that the cs.PCS is not solved with the given witness, without executing plonk workflow

func (*Assert) SolvingSucceeded

func (assert *Assert) SolvingSucceeded(sparseR1cs frontend.CompiledConstraintSystem, witness frontend.Circuit)

SolvingSucceeded Verifies that the sparse constraint system is solved with the given witness, without executing plonk workflow

type Proof

type Proof interface{}

Proof content might vary according to the PLONK version which is chosen.

For instance it can be the commitments of L,R,O,H,Z and the opening proofs.

func Prove

func Prove(sparseR1cs frontend.CompiledConstraintSystem, publicData PublicData, fullWitness frontend.Circuit) (Proof, error)

Prove generates PLONK proof from a circuit, associated preprocessed public data, and the witness

type PublicData

type PublicData interface{}

PublicData contains

  • polynomials corresponding to the coefficients ql,qr,qm,qo,qk (either raw or committed)
  • polynomials corresponding to the permutations s1,s2,s3 (either raw or committed)
  • the commitment scheme
  • the fft domains

func Setup

func Setup(sparseR1cs frontend.CompiledConstraintSystem, polynomialCommitment polynomial.CommitmentScheme, publicWitness frontend.Circuit) (PublicData, error)

Setup prepares the public data associated to a circuit + public inputs.

func SetupDummyCommitment

func SetupDummyCommitment(sparseR1cs frontend.CompiledConstraintSystem, publicWitness frontend.Circuit) (PublicData, error)

SetupDummyCommitment is used for testing purposes, it sets up public data with dummy polynomial commitment scheme.

Jump to

Keyboard shortcuts

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