You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
arnaucube 8df45c7a91 Update compile-circuits.sh to adapt null from json, update GH Actions to install snarkjs & circom for testdata generation 4 years ago
.github/workflows Update compile-circuits.sh to adapt null from json, update GH Actions to install snarkjs & circom for testdata generation 4 years ago
testdata Add testdata big&small circuits, update proof parsers, add compile-circuits.sh 4 years ago
.gitignore Add testdata big&small circuits, update proof parsers, add compile-circuits.sh 4 years ago
LICENSE Add arithmetic mod operations 4 years ago
README.md Add benchmarks, Rename repo, update README.md 4 years ago
arithmetic.go Update exposed methods, update README.md, add godoc & goreport cards 4 years ago
compile-circuits.sh Update compile-circuits.sh to adapt null from json, update GH Actions to install snarkjs & circom for testdata generation 4 years ago
go.mod Update exposed methods, update README.md, add godoc & goreport cards 4 years ago
go.sum Update exposed methods, update README.md, add godoc & goreport cards 4 years ago
ifft.go Add Proof to string in circom/snarkjs format 4 years ago
parsers.go Add Verifier Groth16 compatible with circom 4 years ago
parsers_test.go Update exposed methods, update README.md, add godoc & goreport cards 4 years ago
prover.go Add Verifier Groth16 compatible with circom 4 years ago
prover_test.go Add benchmarks, Rename repo, update README.md 4 years ago
verifier.go Add Verifier Groth16 compatible with circom 4 years ago
verifier_test.go Add benchmarks, Rename repo, update README.md 4 years ago

README.md

go-circom-prover-verifier GoDoc Go Report Card

Experimental Go implementation of the Groth16 protocol zkSNARK prover & verifier compatible with circom.

Using bn256 (used by go-ethereum) for the Pairing curve operations.

Example

// 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)

proofStr, err := circomprover.ProofToString(proof)
assert.Nil(t, err)
publicStr, err := json.Marshal(circomprover.ArrayBigIntToString(pubSignals)
assert.Nil(t, err)

fmt.Println(proofStr)
fmt.Println(publicStr)