Documentation ¶
Index ¶
- func DummySetup(r1cs *bls381backend.R1CS, pk *ProvingKey)
- func ParsePublicInput(expectedNames []string, input map[string]interface{}) ([]fr.Element, error)
- func Setup(r1cs *bls381backend.R1CS, pk *ProvingKey, vk *VerifyingKey)
- func Verify(proof *Proof, vk *VerifyingKey, inputs map[string]interface{}) error
- type Proof
- type ProvingKey
- type VerifyingKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DummySetup ¶
func DummySetup(r1cs *bls381backend.R1CS, pk *ProvingKey)
DummySetup fills a random ProvingKey used for test or benchmarking purposes
func ParsePublicInput ¶
ParsePublicInput return the ordered public input values in regular form (used as scalars for multi exponentiation). The function is public because it's needed for the recursive snark.
func Setup ¶
func Setup(r1cs *bls381backend.R1CS, pk *ProvingKey, vk *VerifyingKey)
Setup constructs the SRS
Types ¶
type Proof ¶
Proof represents a Groth16 proof that was encoded with a ProvingKey and can be verified with a valid statement and a VerifyingKey
func Prove ¶
func Prove(r1cs *bls381backend.R1CS, pk *ProvingKey, solution map[string]interface{}) (*Proof, error)
Prove creates proof from a circuit
type ProvingKey ¶
type ProvingKey struct { // [α]1, [β]1, [δ]1 // [A(t)]1, [B(t)]1, [Kpk(t)]1, [Z(t)]1 G1 struct { Alpha, Beta, Delta curve.G1Affine A, B, Z []curve.G1Affine K []curve.G1Affine // the indexes correspond to the private wires } // [β]2, [δ]2, [B(t)]2 G2 struct { Beta, Delta curve.G2Affine B []curve.G2Affine } }
ProvingKey is used by a Groth16 prover to encode a proof of a statement
func (*ProvingKey) GetCurveID ¶
func (pk *ProvingKey) GetCurveID() gurvy.ID
GetCurveID returns the curveID
func (*ProvingKey) IsDifferent ¶
func (pk *ProvingKey) IsDifferent(_other interface{}) bool
IsDifferent returns true if provided pk is different than self this is used by groth16.Assert to ensure random sampling
type VerifyingKey ¶
type VerifyingKey struct { // e(α, β) E curve.PairingResult // -[γ]2, -[δ]2 // note: storing GammaNeg and DeltaNeg instead of Gamma and Delta // see proof.Verify() for more details G2 struct { GammaNeg, DeltaNeg curve.G2Affine } // [Kvk]1 G1 struct { K []curve.G1Affine // The indexes correspond to the public wires } PublicInputs []string // maps the name of the public input }
VerifyingKey is used by a Groth16 verifier to verify the validity of a proof and a statement
func (*VerifyingKey) GetCurveID ¶
func (pk *VerifyingKey) GetCurveID() gurvy.ID
GetCurveID returns the curveID
func (*VerifyingKey) IsDifferent ¶
func (vk *VerifyingKey) IsDifferent(_other interface{}) bool
IsDifferent returns true if provided vk is different than self this is used by groth16.Assert to ensure random sampling