Skip to content

Commit

Permalink
dependencies updated
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmenendez committed Nov 5, 2024
1 parent 27cabae commit d2af314
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 58 deletions.
1 change: 1 addition & 0 deletions arbo/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ func CheckProof(api frontend.API, key, value, root, nsiblings frontend.Variable,
if err != nil {
return err
}

// calculta the path from the provided key to decide which leaf is the
// correct one in every level of the tree
path := api.ToBinary(key, api.Compiler().FieldBitLen())
Expand Down
10 changes: 2 additions & 8 deletions arbo/verifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ package arbo

import (
"encoding/hex"
"fmt"
"math/big"
"testing"

"github.com/consensys/gnark-crypto/ecc"
"github.com/consensys/gnark/backend"
"github.com/consensys/gnark/backend/hint"
"github.com/consensys/gnark/constraint/solver"
"github.com/consensys/gnark/frontend"
"github.com/consensys/gnark/test"
qt "github.com/frankban/quicktest"
Expand All @@ -30,10 +29,6 @@ func (circuit *testVerifierCircuit) Define(api frontend.API) error {
return CheckProof(api, circuit.Key, circuit.Value, circuit.Root, circuit.NSiblings, circuit.Siblings[:])
}

func init() {
hint.Register(ValidSiblings)
}

func successInputs(t *testing.T, n int) testVerifierCircuit {
c := qt.New(t)

Expand Down Expand Up @@ -66,7 +61,6 @@ func successInputs(t *testing.T, n int) testVerifierCircuit {

uSiblings, err := arbo.UnpackSiblings(arbo.HashFunctionPoseidon, pSiblings)
c.Assert(err, qt.IsNil)
fmt.Println(len(uSiblings))

siblings := [160]frontend.Variable{}
for i := 0; i < 160; i++ {
Expand All @@ -92,5 +86,5 @@ func TestVerifier(t *testing.T) {
assert := test.NewAssert(t)

inputs := successInputs(t, 10)
assert.SolvingSucceeded(&testVerifierCircuit{}, &inputs, test.WithCurves(ecc.BN254), test.WithBackends(backend.GROTH16))
assert.SolvingSucceeded(&testVerifierCircuit{}, &inputs, test.WithCurves(ecc.BN254), test.WithBackends(backend.GROTH16), test.WithSolverOpts(solver.WithHints(ValidSiblings)))
}
37 changes: 22 additions & 15 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,39 +1,44 @@
module github.com/vocdoni/gnark-crypto-primitives

go 1.20
go 1.22

toolchain go1.22.4

require (
github.com/consensys/gnark v0.8.0
github.com/consensys/gnark-crypto v0.9.1
github.com/frankban/quicktest v1.14.5
github.com/consensys/gnark v0.11.0
github.com/consensys/gnark-crypto v0.14.0
github.com/frankban/quicktest v1.14.6
github.com/iden3/go-iden3-crypto v0.0.15
go.vocdoni.io/dvote v1.7.0
)

require (
github.com/DataDog/zstd v1.4.8 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bits-and-blooms/bitset v1.14.3 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cockroachdb/errors v1.8.9 // indirect
github.com/cockroachdb/logtags v0.0.0-20211118104740-dabe8e521a4f // indirect
github.com/cockroachdb/pebble v0.0.0-20230309163202-51422ae2d449 // indirect
github.com/cockroachdb/redact v1.1.3 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/bavard v0.1.22 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fxamacker/cbor/v2 v2.4.0 // indirect
github.com/fxamacker/cbor/v2 v2.7.0 // indirect
github.com/getsentry/sentry-go v0.12.0 // indirect
github.com/glendc/go-external-ip v0.1.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/pprof v0.0.0-20230207041349-798e818bf904 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/pprof v0.0.0-20241101162523-b92577c0c142 // indirect
github.com/ingonyama-zk/icicle v1.1.0 // indirect
github.com/ingonyama-zk/iciclegnark v0.1.0 // indirect
github.com/klauspost/compress v1.16.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
Expand All @@ -42,13 +47,15 @@ require (
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/rs/zerolog v1.29.0 // indirect
github.com/stretchr/testify v1.8.2 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/ronanh/intcomp v1.1.0 // indirect
github.com/rs/zerolog v1.33.0 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/exp v0.0.0-20230310171629-522b1b587ee0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/crypto v0.28.0 // indirect
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.26.0 // indirect
google.golang.org/protobuf v1.28.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
Expand Down
Loading

0 comments on commit d2af314

Please sign in to comment.