This is a archieved, submission code. Go to ringo-snark repository for further updates.
First, run the jindo-modulus utility to generate the code for large prime field arithmetic.
$ go run ./jindo-modulus -n <bit length> -o <output directory>
This will create a package named zp in the output directory.
N := 1 << 10
batch := 10
// Parameters are automatically selected
params := jindo.NewParameters[*zp.Uint](N, batch)
v := make([][]*zp.Uint, batch)
for i := range batch {
v[i] = make([]*zp.Uint, N)
for j := range N {
v[i][j] = new(zp.Uint).New().MustSetRandom()
}
}
crs := []byte("Woof Woof")
prv := jindo.NewProver[*zp.Uint](params, crs)
vrf := jindo.NewVerifier[*zp.Uint](params, crs)
com := make([]*jindo.Commitment, batch)
open := make([]*jindo.Opening, batch)
for i := range batch {
com[i], open[i] = prv.Commit(v[i])
}
x := new(zp.Uint).New().MustSetRandom()
y, pf := prv.Evaluate(x, v, com, open)
ok := vrf.Verify(x, com, y, pf)
fmt.Println(ok)For Jindo benchmarks, run
$ go test ./jindo -v
For Buckler benchmarks, run
$ go test ./buckler -v