Documentation ¶
Overview ¶
Package plonk implements PLONK Zero Knowledge Proof system.
See also ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCS ¶
func NewCS(curveID ecc.ID) constraint.ConstraintSystem
NewCS instantiate a concrete curved-typed SparseR1CS and return a ConstraintSystem interface This method exists for (de)serialization purposes
func Setup ¶
func Setup(ccs constraint.ConstraintSystem, kzgSRS kzg.SRS) (ProvingKey, VerifyingKey, error)
Setup prepares the public data associated to a circuit + public inputs.
Types ¶
type Proof ¶
type Proof interface { io.WriterTo io.ReaderFrom gnarkio.WriterRawTo }
Proof represents a Plonk proof generated by plonk.Prove
it's underlying implementation is curve specific (see gnark/internal/backend)
func NewProof ¶
NewProof instantiates a curve-typed ProvingKey and returns an interface This function exists for serialization purposes
func Prove ¶
func Prove(ccs constraint.ConstraintSystem, pk ProvingKey, fullWitness witness.Witness, opts ...backend.ProverOption) (Proof, error)
Prove generates PLONK proof from a circuit, associated preprocessed public data, and the witness if the force flag is set:
will executes all the prover computations, even if the witness is invalid will produce an invalid proof internally, the solution vector to the SparseR1CS will be filled with random values which may impact benchmarking
type ProvingKey ¶
type ProvingKey interface { io.WriterTo io.ReaderFrom InitKZG(srs kzg.SRS) error VerifyingKey() interface{} }
ProvingKey represents a plonk ProvingKey
it's underlying implementation is strongly typed with the curve (see gnark/internal/backend)
func NewProvingKey ¶
func NewProvingKey(curveID ecc.ID) ProvingKey
NewProvingKey instantiates a curve-typed ProvingKey and returns an interface This function exists for serialization purposes
type VerifyingKey ¶
type VerifyingKey interface { io.WriterTo io.ReaderFrom InitKZG(srs kzg.SRS) error NbPublicWitness() int // number of elements expected in the public witness ExportSolidity(w io.Writer) error }
VerifyingKey represents a plonk VerifyingKey
it's underlying implementation is strongly typed with the curve (see gnark/internal/backend)
func NewVerifyingKey ¶
func NewVerifyingKey(curveID ecc.ID) VerifyingKey
NewVerifyingKey instantiates a curve-typed VerifyingKey and returns an interface This function exists for serialization purposes