go-snark/circuitcompiler/circuit.go
circuitcompiler/circuit.goRaw
1package circuitcompiler
2
3import (
4 "fmt"
5 "math/big"
6)
7
8type Circuit struct {
9 NVars int
10 NPublic int
11 NSignals int
12 Inputs []string
13 Signals []string
14 Witness []*big.Int
15 Constraints []Constraint
16 R1CS struct {
17 A [][]*big.Int
18 B [][]*big.Int
19 C [][]*big.Int
20 }
21}
22
23func (c *Circuit) GenerateR1CS() {
24 fmt.Print("function with inputs: ")
25 fmt.Println(c.Inputs)
26 fmt.Print("signals: ")
27 fmt.Println(c.Signals)
28 for _, constraint := range c.Constraints {
29 fmt.Println(constraint.Literal)
30
31 }
32}