arnaucube 198eeee493 | 4 years ago | |
---|---|---|
testdata | 4 years ago | |
LICENSE | 4 years ago | |
README.md | 4 years ago | |
arithmetic.go | 4 years ago | |
go.mod | 4 years ago | |
go.sum | 4 years ago | |
ifft.go | 4 years ago | |
parsers.go | 4 years ago | |
parsers_test.go | 4 years ago | |
prover.go | 4 years ago | |
prover_test.go | 4 years ago |
Experimental Go implementation of the Groth16 protocol zkSNARK prover compatible with circom.
Using bn256 (used by go-ethereum) for the Pairing curve operations.
// read ProvingKey & Witness files
provingKeyJson, _ := ioutil.ReadFile("testdata/provingkey.json")
witnessJson, _ := ioutil.ReadFile("testdata/witness.json")
// parse Proving Key
pk, _ := circomprover.ParseProvingKey(provingKeyJson)
// parse Witness
w, _ := circomprover.ParseWitness(witnessJson)
// generate the proof
proof, pubSignals, err := circomprover.GenerateProof(pk, w)
assert.Nil(t, err)
fmt.Println(pubSignals)
fmt.Println(proof)