Update exposed methods, update README.md, add godoc & goreport cards

This commit is contained in:
arnaucube
2020-04-03 16:42:31 +02:00
parent 89e71b617a
commit d5c971e59a
9 changed files with 113 additions and 82 deletions

View File

@@ -1,5 +1,26 @@
# go-circom-prover
Experimental Go zkSNARK prover compatible with [circom](https://github.com/iden3/circom).
# go-circom-prover [![GoDoc](https://godoc.org/github.com/iden3/go-circom-prover?status.svg)](https://godoc.org/github.com/iden3/go-circom-prover) [![Go Report Card](https://goreportcard.com/badge/github.com/iden3/go-circom-prover)](https://goreportcard.com/report/github.com/iden3/go-circom-prover)
Experimental Go implementation of the [Groth16 protocol](https://eprint.iacr.org/2016/260.pdf) zkSNARK prover compatible with [circom](https://github.com/iden3/circom).
Using [bn256](https://github.com/ethereum/go-ethereum/tree/master/crypto/bn256/cloudflare) (used by [go-ethereum](https://github.com/ethereum/go-ethereum)) for the Pairing.
Using [bn256](https://github.com/ethereum/go-ethereum/tree/master/crypto/bn256/cloudflare) (used by [go-ethereum](https://github.com/ethereum/go-ethereum)) for the Pairing curve operations.
### Example
```go
// 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)
```