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[*zp.Uint], batch)
for i := range batch {
com[i], open[i] = prv.Commit(v[i])
}
x := new(zp.Uint).New().MustSetRandom()
y := make([]*zp.Uint, batch)
for i := range batch {
y[i] = (&bigpoly.Poly[*zp.Uint]{Coeffs: v[i]}).Evaluate(x)
}
pf := prv.Evaluate(x, y, com, open)
ok := vrf.Verify(x, y, com, pf)
fmt.Println(ok)For Jindo benchmarks, run
$ go test ./jindo -run=^$ -bench=.
For Buckler benchmarks, run
$ go test ./buckler -run=^$ -bench=.