Documentation ¶
Overview ¶
Package plookup provides an API to build plookup proofs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func VerifyLookupTables ¶
func VerifyLookupTables(vk kzg.VerifyingKey, proof ProofLookupTables) error
VerifyLookupTables verifies that a ProofLookupTables proof is correct.
func VerifyLookupVector ¶
func VerifyLookupVector(vk kzg.VerifyingKey, proof ProofLookupVector) error
VerifyLookupVector verifies that a ProofLookupVector proof is correct
Types ¶
type ProofLookupTables ¶
type ProofLookupTables struct {
// contains filtered or unexported fields
}
ProofLookupTables proofs that a list of tables
func ProveLookupTables ¶
func ProveLookupTables(pk kzg.ProvingKey, f, t []fr.Vector) (ProofLookupTables, error)
ProveLookupTables generates a proof that f, seen as a multi dimensional table, consists of vectors that are in t. In other words for each i, f[:][i] must be one of the t[:][j].
For instance, if t is the truth table of the XOR function, t will be populated such that t[:][i] contains the i-th entry of the truth table, so t[0][i] XOR t[1][i] = t[2][i].
The fr.Vector in f and t are supposed to be of the same size constant size.
type ProofLookupVector ¶
type ProofLookupVector struct { // Batch opening proof of h1, h2, z, t BatchedProof kzg.BatchOpeningProof // Batch opening proof of h1, h2, z shifted by g BatchedProofShifted kzg.BatchOpeningProof // contains filtered or unexported fields }
Proof Plookup proof, containing opening proofs
func ProveLookupVector ¶
func ProveLookupVector(pk kzg.ProvingKey, f, t fr.Vector) (ProofLookupVector, error)
ProveLookupVector returns proof that the values in f are in t.
/!\IMPORTANT/!\
If the table t is already committed somewhere (which is the normal workflow before generating a lookup proof), the commitment needs to be done on the table sorted. Otherwise the commitment in proof.t will not be the same as the public commitment: it will contain the same values, but permuted.