go-circom-prover-verifier/types/types.go
types/types.goRaw
1package types
2
3import (
4 "math/big"
5
6 bn256 "github.com/ethereum/go-ethereum/crypto/bn256/cloudflare"
7)
8
9var Q, _ = new(big.Int).SetString("21888242871839275222246405745257275088696311157297823662689037894645226208583", 10)
10
11// R is the mod of the finite field
12var R, _ = new(big.Int).SetString("21888242871839275222246405745257275088548364400416034343698204186575808495617", 10)
13
14// Proof is the data structure of the Groth16 zkSNARK proof
15type Proof struct {
16 A *bn256.G1
17 B *bn256.G2
18 C *bn256.G1
19}
20
21// Pk holds the data structure of the ProvingKey
22type Pk struct {
23 A []*bn256.G1
24 B2 []*bn256.G2
25 B1 []*bn256.G1
26 C []*bn256.G1
27 NVars int
28 NPublic int
29 VkAlpha1 *bn256.G1
30 VkDelta1 *bn256.G1
31 VkBeta1 *bn256.G1
32 VkBeta2 *bn256.G2
33 VkDelta2 *bn256.G2
34 HExps []*bn256.G1
35 DomainSize int
36 PolsA []map[int]*big.Int
37 PolsB []map[int]*big.Int
38 PolsC []map[int]*big.Int
39}
40
41// Witness contains the witness
42type Witness []*big.Int
43
44// Vk is the Verification Key data structure
45type Vk struct {
46 Alpha *bn256.G1
47 Beta *bn256.G2
48 Gamma *bn256.G2
49 Delta *bn256.G2
50 IC []*bn256.G1
51}