Skip to content

Commit

Permalink
Merge pull request #160 from ConsenSys/perf-unsafe-decoding
Browse files Browse the repository at this point in the history
feat: added UnsafeReadFrom for groth16 Proving and Verifying keys
  • Loading branch information
gbotrel authored Oct 29, 2021
2 parents d9de872 + 7a6abbe commit 71df9c6
Show file tree
Hide file tree
Showing 15 changed files with 456 additions and 544 deletions.
2 changes: 2 additions & 0 deletions backend/groth16/groth16.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ type Proof interface {
// it's underlying implementation is strongly typed with the curve (see gnark/internal/backend)
type ProvingKey interface {
groth16Object
gnarkio.UnsafeReaderFrom

// NbG1 returns the number of G1 elements in the ProvingKey
NbG1() int
Expand All @@ -85,6 +86,7 @@ type ProvingKey interface {
// ExportSolidity is implemented for BN254 and will return an error with other curves
type VerifyingKey interface {
groth16Object
gnarkio.UnsafeReaderFrom

// NbPublicWitness returns number of elements expected in the public witness
NbPublicWitness() int
Expand Down
150 changes: 51 additions & 99 deletions internal/backend/bls12-377/groth16/groth16_test.go

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

26 changes: 22 additions & 4 deletions internal/backend/bls12-377/groth16/marshal.go

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

Loading

0 comments on commit 71df9c6

Please sign in to comment.