Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions backend/groth16/bls12-377/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions backend/groth16/bls12-377/verify.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions backend/groth16/bls12-381/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 82 additions & 0 deletions backend/groth16/bls12-381/verify.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 44 additions & 0 deletions backend/groth16/bn254/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 82 additions & 0 deletions backend/groth16/bn254/verify.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions backend/groth16/bw6-761/prove.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions backend/groth16/bw6-761/verify.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions backend/groth16/groth16.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/backend"
"github.com/consensys/gnark/backend/snarkjs"
"github.com/consensys/gnark/backend/solidity"
"github.com/consensys/gnark/backend/witness"
"github.com/consensys/gnark/constraint"
Expand Down Expand Up @@ -46,6 +47,9 @@ type Proof interface {
// Raw methods for faster serialization-deserialization. Does not perform checks on the data.
// Only use if you are sure of the data you are reading comes from trusted source.
gnarkio.WriterRawTo

// Methods required to generate a proof JSON file compatible with snarkjs
snarkjs.Proof
}

// ProvingKey represents a Groth16 ProvingKey
Expand Down Expand Up @@ -98,6 +102,9 @@ type VerifyingKey interface {
// supported on the CurveID().
solidity.VerifyingKey

// Methods required to generate a verification key JSON file compatible with snarkjs
snarkjs.VerifyingKey

// NbPublicWitness returns number of elements expected in the public witness
NbPublicWitness() int

Expand Down
10 changes: 10 additions & 0 deletions backend/snarkjs/proof.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package snarkjs

import (
"io"
)

// VerifyingKey is the interface for verifying keys in the SnarkJS backend.
type Proof interface {
ExportProof([]string, io.Writer) error
}
Loading