Not finished, work in progress (doing this in my free time, so I don't have much time).
#### Test
```
go test ./... -v
```
## R1CS to Quadratic Arithmetic Program
- `Succinct Non-Interactive Zero Knowledge for a von Neumann Architecture`, Eli Ben-Sasson, Alessandro Chiesa, Eran Tromer, Madars Virza https://eprint.iacr.org/2013/879.pdf
- Vitalik Buterin blog post about QAP https://medium.com/@VitalikButerin/quadratic-arithmetic-programs-from-zero-to-hero-f6d558cea649
@ -20,39 +18,49 @@ go test ./... -v
#### Usage
- R1CS to QAP
```go
b0 := big.NewFloat(float64(0))
b1 := big.NewFloat(float64(1))
b5 := big.NewFloat(float64(5))
a := [][]*big.Float{
[]*big.Float{b0, b1, b0, b0, b0, b0},
[]*big.Float{b0, b0, b0, b1, b0, b0},
[]*big.Float{b0, b1, b0, b0, b1, b0},
[]*big.Float{b5, b0, b0, b0, b0, b1},
pf := NewPolynomialField(f)
b0 := big.NewInt(int64(0))
b1 := big.NewInt(int64(1))
b3 := big.NewInt(int64(3))
b5 := big.NewInt(int64(5))
b9 := big.NewInt(int64(9))
b27 := big.NewInt(int64(27))
b30 := big.NewInt(int64(30))
b35 := big.NewInt(int64(35))
a := [][]*big.Int{
[]*big.Int{b0, b1, b0, b0, b0, b0},
[]*big.Int{b0, b0, b0, b1, b0, b0},
[]*big.Int{b0, b1, b0, b0, b1, b0},
[]*big.Int{b5, b0, b0, b0, b0, b1},
}
b := [][]*big.Float{
[]*big.Float{b0, b1, b0, b0, b0, b0},
[]*big.Float{b0, b1, b0, b0, b0, b0},
[]*big.Float{b1, b0, b0, b0, b0, b0},
[]*big.Float{b1, b0, b0, b0, b0, b0},
b := [][]*big.Int{
[]*big.Int{b0, b1, b0, b0, b0, b0},
[]*big.Int{b0, b1, b0, b0, b0, b0},
[]*big.Int{b1, b0, b0, b0, b0, b0},
[]*big.Int{b1, b0, b0, b0, b0, b0},
}
c := [][]*big.Float{
[]*big.Float{b0, b0, b0, b1, b0, b0},
[]*big.Float{b0, b0, b0, b0, b1, b0},
[]*big.Float{b0, b0, b0, b0, b0, b1},
[]*big.Float{b0, b0, b1, b0, b0, b0},
c := [][]*big.Int{
[]*big.Int{b0, b0, b0, b1, b0, b0},
[]*big.Int{b0, b0, b0, b0, b1, b0},
[]*big.Int{b0, b0, b0, b0, b0, b1},
[]*big.Int{b0, b0, b1, b0, b0, b0},
}
alpha, beta, gamma, z := R1CSToQAP(a, b, c)
fmt.Println(alpha)
fmt.Println(beta)
fmt.Println(gamma)
alphas, betas, gammas, zx := pf.R1CSToQAP(a, b, c)