Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Proof ¶
type Proof struct {
Ar, Krs curve.G1Affine
Bs curve.G2Affine
Commitment, CommitmentPok curve.G1Affine
}
Proof represents a Groth16 proof that was encoded with a ProvingKey and can be verified with a valid statement and a VerifyingKey Notation follows Figure 4. in DIZK paper https://eprint.iacr.org/2018/691.pdf
func Prove ¶
Prove generates the proof of knowledge of a r1cs with full witness (secret + public part).
func (*Proof) ReadFrom ¶
ReadFrom attempts to decode a Proof from reader Proof must be encoded through WriteTo (compressed) or WriteRawTo (uncompressed)
func (*Proof) WriteRawTo ¶
WriteRawTo writes binary encoding of the Proof elements to writer points are stored in uncompressed form Ar | Krs | Bs use WriteTo(...) to encode the proof with point compression
type ProvingKey ¶
type ProvingKey struct { // domain Domain fft.Domain // [α]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 } // if InfinityA[i] == true, the point G1.A[i] == infinity InfinityA, InfinityB []bool NbInfinityA, NbInfinityB uint64 CommitmentKey pedersen.ProvingKey }
ProvingKey is used by a Groth16 prover to encode a proof of a statement Notation follows Figure 4. in DIZK paper https://eprint.iacr.org/2018/691.pdf
func (*ProvingKey) ReadFrom ¶
func (pk *ProvingKey) ReadFrom(r io.Reader) (int64, error)
ReadFrom attempts to decode a ProvingKey from reader ProvingKey must be encoded through WriteTo (compressed) or WriteRawTo (uncompressed) note that we don't check that the points are on the curve or in the correct subgroup at this point
func (*ProvingKey) UnsafeReadFrom ¶
func (pk *ProvingKey) UnsafeReadFrom(r io.Reader) (int64, error)
UnsafeReadFrom behaves like ReadFrom excepts it doesn't check if the decoded points are on the curve or in the correct subgroup