arnaucube
arnaucube/go-circom-prover-verifierPublic Self-hosted repository
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
 9// R is the mod of the finite field
10var R, _ = new(big.Int).SetString("21888242871839275222246405745257275088548364400416034343698204186575808495617", 10)
11
12// Proof is the data structure of the Groth16 zkSNARK proof
13type Proof struct {
14	A *bn256.G1
15	B *bn256.G2
16	C *bn256.G1
17}
18
19// Pk holds the data structure of the ProvingKey
20type Pk struct {
21	A          []*bn256.G1
22	B2         []*bn256.G2
23	B1         []*bn256.G1
24	C          []*bn256.G1
25	NVars      int
26	NPublic    int
27	VkAlpha1   *bn256.G1
28	VkDelta1   *bn256.G1
29	VkBeta1    *bn256.G1
30	VkBeta2    *bn256.G2
31	VkDelta2   *bn256.G2
32	HExps      []*bn256.G1
33	DomainSize int
34	PolsA      []map[int]*big.Int
35	PolsB      []map[int]*big.Int
36	PolsC      []map[int]*big.Int
37}
38
39// Witness contains the witness
40type Witness []*big.Int
41
42// Vk is the Verification Key data structure
43type Vk struct {
44	Alpha *bn256.G1
45	Beta  *bn256.G2
46	Gamma *bn256.G2
47	Delta *bn256.G2
48	IC    []*bn256.G1
49}