From eb1876387732c2d8fe9ab9601e1fdb5df52f6311 Mon Sep 17 00:00:00 2001 From: Ivo Kubjas Date: Fri, 24 Jan 2025 01:16:49 +0100 Subject: [PATCH] release: v0.12.0 (#1399) --- CHANGELOG.md | 99 ++++++++++++++++++- README.md | 10 +- backend/groth16/bls12-377/verify.go | 3 +- backend/groth16/bls12-381/verify.go | 3 +- backend/groth16/bls24-315/verify.go | 3 +- backend/groth16/bls24-317/verify.go | 3 +- backend/groth16/bn254/verify.go | 3 +- backend/groth16/bw6-633/verify.go | 3 +- backend/groth16/bw6-761/verify.go | 3 +- constraint/gkr.go | 3 +- doc.go | 2 +- docs/CITATION.bib | 10 +- go.mod | 14 +-- go.sum | 28 +++--- .../zkpschemes/groth16/groth16.verify.go.tmpl | 3 +- std/recursion/groth16/verifier.go | 3 +- 16 files changed, 137 insertions(+), 56 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ba0ddea18..a1c008fccd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,97 @@ + +## [v0.12.0] - 2025-01-23 +### Build +- modify workflows for new CI slack bot ([#1277](https://github.com/Consensys/gnark/issues/1277)) +- **deps:** bump golang.org/x/crypto from 0.26.0 to 0.31.0 ([#1346](https://github.com/Consensys/gnark/issues/1346)) + +### Chore +- use max builtin +- go mod update +- generate changelog +- update citation +- update hardcoded version +- fix some struct names in comment ([#1370](https://github.com/Consensys/gnark/issues/1370)) +- fix typos ([#1371](https://github.com/Consensys/gnark/issues/1371)) +- fix error message ([#1337](https://github.com/Consensys/gnark/issues/1337)) +- use errors.New to replace fmt.Errorf with no parameters ([#1338](https://github.com/Consensys/gnark/issues/1338)) +- fix some problematic function names in comment ([#1334](https://github.com/Consensys/gnark/issues/1334)) +- fix some struct and interface names in comment ([#1329](https://github.com/Consensys/gnark/issues/1329)) +- remove duplicate nil-check ([#1355](https://github.com/Consensys/gnark/issues/1355)) +- fix some function names in comment ([#1304](https://github.com/Consensys/gnark/issues/1304)) +- Replace fmt.Printf calls with warning logs ([#1305](https://github.com/Consensys/gnark/issues/1305)) +- Pedersen verification key reference field ([#1295](https://github.com/Consensys/gnark/issues/1295)) +- lint generated files ([#1289](https://github.com/Consensys/gnark/issues/1289)) +- up gnark-crypto ([#1274](https://github.com/Consensys/gnark/issues/1274)) + +### Doc +- add audit report ([#1342](https://github.com/Consensys/gnark/issues/1342)) + +### Docs +- Change copyright year to 2025 (not autogenerated) ([#1388](https://github.com/Consensys/gnark/issues/1388)) +- less verbose Apache 2 header, latest bavard ([#1344](https://github.com/Consensys/gnark/issues/1344)) +- add input packing example ([#1311](https://github.com/Consensys/gnark/issues/1311)) +- update api doc following audit suggestions ([#1291](https://github.com/Consensys/gnark/issues/1291)) +- final audit report from LA ([#1283](https://github.com/Consensys/gnark/issues/1283)) + +### Feat +- settable hasher for MiMC ([#1345](https://github.com/Consensys/gnark/issues/1345)) +- 4-dimensional fake GLV ([#1296](https://github.com/Consensys/gnark/issues/1296)) + +### Feat +- add ripemd160 hash function with permutation ([#1120](https://github.com/Consensys/gnark/issues/1120)) +- direct multivariate polynomial evaluation in non-native ([#1299](https://github.com/Consensys/gnark/issues/1299)) +- update to latest gnark-crypto +- replace stats gob format with csv for easier diffs ([#1276](https://github.com/Consensys/gnark/issues/1276)) +- **bls12-381:** pairing using direct Fp12 + non-native `Eval()` ([#1349](https://github.com/Consensys/gnark/issues/1349)) + +### Fix +- stashed typo fixes for v0.12 ([#1398](https://github.com/Consensys/gnark/issues/1398)) +- add G2 membership check for constant points ([#1397](https://github.com/Consensys/gnark/issues/1397)) +- do not return unused sign ([#1385](https://github.com/Consensys/gnark/issues/1385)) +- typos in documentation files ([#1369](https://github.com/Consensys/gnark/issues/1369)) +- spellchecker ([#1359](https://github.com/Consensys/gnark/issues/1359)) +- typos in documentation files ([#1327](https://github.com/Consensys/gnark/issues/1327)) +- tinyfield generation with updated gnark-crypto ([#1358](https://github.com/Consensys/gnark/issues/1358)) +- avoid linking icicle dependent files when tag not provided ([#1352](https://github.com/Consensys/gnark/issues/1352)) +- NNA quotient length computation edge cases ([#1340](https://github.com/Consensys/gnark/issues/1340)) +- initialize public committed ([#1317](https://github.com/Consensys/gnark/issues/1317)) +- sanitize groth16 verification key reading ([#1307](https://github.com/Consensys/gnark/issues/1307)) +- expmod precompile if modulus is 1 ([#1294](https://github.com/Consensys/gnark/issues/1294)) +- allow only v=0 or v=1 ([#1293](https://github.com/Consensys/gnark/issues/1293)) +- fix slice init length ([#1288](https://github.com/Consensys/gnark/issues/1288)) + +### Optim +- avoid div in millerLoopAndFinalExpResult ([#1363](https://github.com/Consensys/gnark/issues/1363)) + +### Perf +- `PairingCheck` for BN254, BLS12-381, BLS12-377 and BW6-761 ([#1365](https://github.com/Consensys/gnark/issues/1365)) +- G1/2 membership using Eval ([#1356](https://github.com/Consensys/gnark/issues/1356)) +- using non-native Eval for curve arithmetic ([#1331](https://github.com/Consensys/gnark/issues/1331)) +- normalize the random linear combination in logderivarg ([#1333](https://github.com/Consensys/gnark/issues/1333)) +- BW6 pairing computation using non-native Eval ([#1312](https://github.com/Consensys/gnark/issues/1312)) +- fast path operations for small non-native values ([#1326](https://github.com/Consensys/gnark/issues/1326)) +- **bn254:** include G2 membership check in ML ([#1387](https://github.com/Consensys/gnark/issues/1387)) +- **emulated:** small perf on doubleAndAdd ([#1386](https://github.com/Consensys/gnark/issues/1386)) + +### Perf +- Pairing on BN254 using direct Fp12 extension and non-native `Eval()` ([#1339](https://github.com/Consensys/gnark/issues/1339)) + +### Refactor +- move poseidon2 to permutation package ([#1353](https://github.com/Consensys/gnark/issues/1353)) + +### Test +- add scalar mul to stats ([#1275](https://github.com/Consensys/gnark/issues/1275)) + +### Pull Requests +- Merge pull request [#1298](https://github.com/Consensys/gnark/issues/1298) from Consensys/build/gnark-crypto + + ## [v0.11.0] - 2024-09-06 ### Build - update runner and go version ([#1260](https://github.com/Consensys/gnark/issues/1260)) ### Chore -- update version - explicit IO methods in interfaces ([#1266](https://github.com/Consensys/gnark/issues/1266)) - update gnark-crypto module - clean old definition @@ -57,6 +144,9 @@ ### Feat - implement FixedLengthSum of sha2 ([#821](https://github.com/Consensys/gnark/issues/821)) +### Fix +- Build on 32-bit arch would raise int overflow https://github.com/Consensys/gnark/issues/1192 ([#1195](https://github.com/Consensys/gnark/issues/1195)) + ### Fix - remove redundant select - variable modulus subtraction padding ([#1200](https://github.com/Consensys/gnark/issues/1200)) @@ -116,9 +206,6 @@ - **pairing:** fix benchmarks - **uints:** constrain valueOf ([#1139](https://github.com/Consensys/gnark/issues/1139)) -### Fix -- Build on 32-bit arch would raise int overflow https://github.com/Consensys/gnark/issues/1192 ([#1195](https://github.com/Consensys/gnark/issues/1195)) - ### Perf - eliminate final exp in bls12-381 optimized - eliminate final exp in bls12-377 @@ -171,6 +258,9 @@ - **bw6:** remove benchmark - **bw6:** apply review suggestion +### Release +- v0.11.0 ([#1272](https://github.com/Consensys/gnark/issues/1272)) + ### Style - fixed wrong EcMul comment - fixed comment @@ -3199,6 +3289,7 @@ - Merge pull request [#5](https://github.com/Consensys/gnark/issues/5) from ConsenSys/go1.14_deps +[v0.12.0]: https://github.com/Consensys/gnark/compare/v0.11.0...v0.12.0 [v0.11.0]: https://github.com/Consensys/gnark/compare/v0.10.0...v0.11.0 [v0.10.0]: https://github.com/Consensys/gnark/compare/v0.9.1...v0.10.0 [v0.9.1]: https://github.com/Consensys/gnark/compare/v0.9.0...v0.9.1 diff --git a/README.md b/README.md index 61c9c71c14..63d746abce 100644 --- a/README.md +++ b/README.md @@ -192,17 +192,17 @@ If you use `gnark` in your research a citation would be appreciated. Please use the following BibTeX to cite the most recent release. ```bib -@software{gnark-v0.11.0, +@software{gnark-v0.12.0, author = {Gautam Botrel and Thomas Piellard and Youssef El Housni and Ivo Kubjas and Arya Tabaie}, - title = {Consensys/gnark: v0.11.0}, - month = sep, - year = 2024, + title = {Consensys/gnark: v0.12.0}, + month = jan, + year = 2025, publisher = {Zenodo}, - version = {v0.11.0}, + version = {v0.12.0}, doi = {10.5281/zenodo.5819104}, url = {https://doi.org/10.5281/zenodo.5819104} } diff --git a/backend/groth16/bls12-377/verify.go b/backend/groth16/bls12-377/verify.go index 3c36f182d2..7a86e3dc76 100644 --- a/backend/groth16/bls12-377/verify.go +++ b/backend/groth16/bls12-377/verify.go @@ -16,7 +16,6 @@ import ( "github.com/consensys/gnark-crypto/ecc/bls12-377/fr" "github.com/consensys/gnark-crypto/ecc/bls12-377/fr/hash_to_field" "github.com/consensys/gnark-crypto/ecc/bls12-377/fr/pedersen" - "github.com/consensys/gnark-crypto/utils" "github.com/consensys/gnark/backend" "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/constraint" @@ -64,7 +63,7 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac maxNbPublicCommitted := 0 for _, s := range vk.PublicAndCommitmentCommitted { // iterate over commitments - maxNbPublicCommitted = utils.Max(maxNbPublicCommitted, len(s)) + maxNbPublicCommitted = max(maxNbPublicCommitted, len(s)) } commitmentsSerialized := make([]byte, len(vk.PublicAndCommitmentCommitted)*fr.Bytes) commitmentPrehashSerialized := make([]byte, curve.SizeOfG1AffineUncompressed+maxNbPublicCommitted*fr.Bytes) diff --git a/backend/groth16/bls12-381/verify.go b/backend/groth16/bls12-381/verify.go index baf4163d16..cf47d66ceb 100644 --- a/backend/groth16/bls12-381/verify.go +++ b/backend/groth16/bls12-381/verify.go @@ -16,7 +16,6 @@ import ( "github.com/consensys/gnark-crypto/ecc/bls12-381/fr" "github.com/consensys/gnark-crypto/ecc/bls12-381/fr/hash_to_field" "github.com/consensys/gnark-crypto/ecc/bls12-381/fr/pedersen" - "github.com/consensys/gnark-crypto/utils" "github.com/consensys/gnark/backend" "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/constraint" @@ -64,7 +63,7 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac maxNbPublicCommitted := 0 for _, s := range vk.PublicAndCommitmentCommitted { // iterate over commitments - maxNbPublicCommitted = utils.Max(maxNbPublicCommitted, len(s)) + maxNbPublicCommitted = max(maxNbPublicCommitted, len(s)) } commitmentsSerialized := make([]byte, len(vk.PublicAndCommitmentCommitted)*fr.Bytes) commitmentPrehashSerialized := make([]byte, curve.SizeOfG1AffineUncompressed+maxNbPublicCommitted*fr.Bytes) diff --git a/backend/groth16/bls24-315/verify.go b/backend/groth16/bls24-315/verify.go index 8a4d1f6755..59318d9067 100644 --- a/backend/groth16/bls24-315/verify.go +++ b/backend/groth16/bls24-315/verify.go @@ -16,7 +16,6 @@ import ( "github.com/consensys/gnark-crypto/ecc/bls24-315/fr" "github.com/consensys/gnark-crypto/ecc/bls24-315/fr/hash_to_field" "github.com/consensys/gnark-crypto/ecc/bls24-315/fr/pedersen" - "github.com/consensys/gnark-crypto/utils" "github.com/consensys/gnark/backend" "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/constraint" @@ -64,7 +63,7 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac maxNbPublicCommitted := 0 for _, s := range vk.PublicAndCommitmentCommitted { // iterate over commitments - maxNbPublicCommitted = utils.Max(maxNbPublicCommitted, len(s)) + maxNbPublicCommitted = max(maxNbPublicCommitted, len(s)) } commitmentsSerialized := make([]byte, len(vk.PublicAndCommitmentCommitted)*fr.Bytes) commitmentPrehashSerialized := make([]byte, curve.SizeOfG1AffineUncompressed+maxNbPublicCommitted*fr.Bytes) diff --git a/backend/groth16/bls24-317/verify.go b/backend/groth16/bls24-317/verify.go index e1fafd4549..2623657a68 100644 --- a/backend/groth16/bls24-317/verify.go +++ b/backend/groth16/bls24-317/verify.go @@ -16,7 +16,6 @@ import ( "github.com/consensys/gnark-crypto/ecc/bls24-317/fr" "github.com/consensys/gnark-crypto/ecc/bls24-317/fr/hash_to_field" "github.com/consensys/gnark-crypto/ecc/bls24-317/fr/pedersen" - "github.com/consensys/gnark-crypto/utils" "github.com/consensys/gnark/backend" "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/constraint" @@ -64,7 +63,7 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac maxNbPublicCommitted := 0 for _, s := range vk.PublicAndCommitmentCommitted { // iterate over commitments - maxNbPublicCommitted = utils.Max(maxNbPublicCommitted, len(s)) + maxNbPublicCommitted = max(maxNbPublicCommitted, len(s)) } commitmentsSerialized := make([]byte, len(vk.PublicAndCommitmentCommitted)*fr.Bytes) commitmentPrehashSerialized := make([]byte, curve.SizeOfG1AffineUncompressed+maxNbPublicCommitted*fr.Bytes) diff --git a/backend/groth16/bn254/verify.go b/backend/groth16/bn254/verify.go index 72d376516a..1b8cd2ea81 100644 --- a/backend/groth16/bn254/verify.go +++ b/backend/groth16/bn254/verify.go @@ -22,7 +22,6 @@ import ( "github.com/consensys/gnark-crypto/ecc/bn254/fr" "github.com/consensys/gnark-crypto/ecc/bn254/fr/hash_to_field" "github.com/consensys/gnark-crypto/ecc/bn254/fr/pedersen" - "github.com/consensys/gnark-crypto/utils" "github.com/consensys/gnark/backend" "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/constraint" @@ -70,7 +69,7 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac maxNbPublicCommitted := 0 for _, s := range vk.PublicAndCommitmentCommitted { // iterate over commitments - maxNbPublicCommitted = utils.Max(maxNbPublicCommitted, len(s)) + maxNbPublicCommitted = max(maxNbPublicCommitted, len(s)) } commitmentsSerialized := make([]byte, len(vk.PublicAndCommitmentCommitted)*fr.Bytes) commitmentPrehashSerialized := make([]byte, curve.SizeOfG1AffineUncompressed+maxNbPublicCommitted*fr.Bytes) diff --git a/backend/groth16/bw6-633/verify.go b/backend/groth16/bw6-633/verify.go index 745ba7a7d0..399fdf4891 100644 --- a/backend/groth16/bw6-633/verify.go +++ b/backend/groth16/bw6-633/verify.go @@ -16,7 +16,6 @@ import ( "github.com/consensys/gnark-crypto/ecc/bw6-633/fr" "github.com/consensys/gnark-crypto/ecc/bw6-633/fr/hash_to_field" "github.com/consensys/gnark-crypto/ecc/bw6-633/fr/pedersen" - "github.com/consensys/gnark-crypto/utils" "github.com/consensys/gnark/backend" "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/constraint" @@ -64,7 +63,7 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac maxNbPublicCommitted := 0 for _, s := range vk.PublicAndCommitmentCommitted { // iterate over commitments - maxNbPublicCommitted = utils.Max(maxNbPublicCommitted, len(s)) + maxNbPublicCommitted = max(maxNbPublicCommitted, len(s)) } commitmentsSerialized := make([]byte, len(vk.PublicAndCommitmentCommitted)*fr.Bytes) commitmentPrehashSerialized := make([]byte, curve.SizeOfG1AffineUncompressed+maxNbPublicCommitted*fr.Bytes) diff --git a/backend/groth16/bw6-761/verify.go b/backend/groth16/bw6-761/verify.go index df89379e87..e1ba4a95a4 100644 --- a/backend/groth16/bw6-761/verify.go +++ b/backend/groth16/bw6-761/verify.go @@ -16,7 +16,6 @@ import ( "github.com/consensys/gnark-crypto/ecc/bw6-761/fr" "github.com/consensys/gnark-crypto/ecc/bw6-761/fr/hash_to_field" "github.com/consensys/gnark-crypto/ecc/bw6-761/fr/pedersen" - "github.com/consensys/gnark-crypto/utils" "github.com/consensys/gnark/backend" "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/constraint" @@ -64,7 +63,7 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac maxNbPublicCommitted := 0 for _, s := range vk.PublicAndCommitmentCommitted { // iterate over commitments - maxNbPublicCommitted = utils.Max(maxNbPublicCommitted, len(s)) + maxNbPublicCommitted = max(maxNbPublicCommitted, len(s)) } commitmentsSerialized := make([]byte, len(vk.PublicAndCommitmentCommitted)*fr.Bytes) commitmentPrehashSerialized := make([]byte, curve.SizeOfG1AffineUncompressed+maxNbPublicCommitted*fr.Bytes) diff --git a/constraint/gkr.go b/constraint/gkr.go index e1337cb0b9..07f132a922 100644 --- a/constraint/gkr.go +++ b/constraint/gkr.go @@ -4,7 +4,6 @@ import ( "fmt" "sort" - "github.com/consensys/gnark-crypto/utils" "github.com/consensys/gnark/constraint/solver" "github.com/consensys/gnark/internal/algo_utils" ) @@ -102,7 +101,7 @@ func (d *GkrInfo) Compile(nbInstances int) (GkrPermutations, error) { oldW := d.Circuit[oldI] if !oldW.IsInput() { - d.MaxNIns = utils.Max(d.MaxNIns, len(oldW.Inputs)) + d.MaxNIns = max(d.MaxNIns, len(oldW.Inputs)) } for j := range oldW.Dependencies { diff --git a/doc.go b/doc.go index 02a9a13d57..fd4cb6f5b9 100644 --- a/doc.go +++ b/doc.go @@ -22,7 +22,7 @@ import ( "github.com/consensys/gnark-crypto/ecc" ) -var Version = semver.MustParse("0.11.0") +var Version = semver.MustParse("0.12.0") // Curves return the curves supported by gnark func Curves() []ecc.ID { diff --git a/docs/CITATION.bib b/docs/CITATION.bib index 1ed73fa2d1..d3bcb9b424 100644 --- a/docs/CITATION.bib +++ b/docs/CITATION.bib @@ -1,14 +1,14 @@ -@software{gnark-v0.11.0, +@software{gnark-v0.12.0, author = {Gautam Botrel and Thomas Piellard and Youssef El Housni and Ivo Kubjas and Arya Tabaie}, - title = {ConsenSys/gnark: v0.11.0}, - month = sep, - year = 2024, + title = {ConsenSys/gnark: v0.12.0}, + month = jan, + year = 2025, publisher = {Zenodo}, - version = {v0.11.0}, + version = {v0.12.0}, doi = {10.5281/zenodo.5819104}, url = {https://doi.org/10.5281/zenodo.5819104} } \ No newline at end of file diff --git a/go.mod b/go.mod index caa4a8e03a..dbeef78306 100644 --- a/go.mod +++ b/go.mod @@ -5,11 +5,11 @@ go 1.22 toolchain go1.22.6 require ( - github.com/bits-and-blooms/bitset v1.14.2 + github.com/bits-and-blooms/bitset v1.20.0 github.com/blang/semver/v4 v4.0.0 - github.com/consensys/bavard v0.1.25 + github.com/consensys/bavard v0.1.27 github.com/consensys/compress v0.2.5 - github.com/consensys/gnark-crypto v0.14.1-0.20250116204316-e7fd38b0a0a6 + github.com/consensys/gnark-crypto v0.15.0 github.com/fxamacker/cbor/v2 v2.7.0 github.com/google/go-cmp v0.6.0 github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8 @@ -18,10 +18,10 @@ require ( github.com/leanovate/gopter v0.2.11 github.com/ronanh/intcomp v1.1.0 github.com/rs/zerolog v1.33.0 - github.com/stretchr/testify v1.9.0 - golang.org/x/crypto v0.31.0 + github.com/stretchr/testify v1.10.0 + golang.org/x/crypto v0.32.0 golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 - golang.org/x/sync v0.8.0 + golang.org/x/sync v0.10.0 ) require ( @@ -31,7 +31,7 @@ require ( github.com/mmcloughlin/addchain v0.4.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/x448/float16 v0.8.4 // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.29.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect rsc.io/tmplfunc v0.0.3 // indirect ) diff --git a/go.sum b/go.sum index e20d4967aa..5f24bbd3a5 100644 --- a/go.sum +++ b/go.sum @@ -44,8 +44,8 @@ github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hC github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.14.2 h1:YXVoyPndbdvcEVcseEovVfp0qjJp7S+i5+xgp/Nfbdc= -github.com/bits-and-blooms/bitset v1.14.2/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= +github.com/bits-and-blooms/bitset v1.20.0 h1:2F+rfL86jE2d/bmw7OhqUg2Sj/1rURkBn3MdfoPyRVU= +github.com/bits-and-blooms/bitset v1.20.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/blang/semver/v4 v4.0.0 h1:1PFHFE6yCCTv8C1TeyNNarDzntLi7wMI5i/pzqYIsAM= github.com/blang/semver/v4 v4.0.0/go.mod h1:IbckMUScFkM3pff0VJDNKRiT6TG/YpiHIM2yvyW5YoQ= @@ -57,12 +57,12 @@ github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDk github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= -github.com/consensys/bavard v0.1.25 h1:5YcSBnp03/HvfpKaIQLr/ecspTp2k8YNR5rQLOWvUyc= -github.com/consensys/bavard v0.1.25/go.mod h1:k/zVjHHC4B+PQy1Pg7fgvG3ALicQw540Crag8qx+dZs= +github.com/consensys/bavard v0.1.27 h1:j6hKUrGAy/H+gpNrpLU3I26n1yc+VMGmd6ID5+gAhOs= +github.com/consensys/bavard v0.1.27/go.mod h1:k/zVjHHC4B+PQy1Pg7fgvG3ALicQw540Crag8qx+dZs= github.com/consensys/compress v0.2.5 h1:gJr1hKzbOD36JFsF1AN8lfXz1yevnJi1YolffY19Ntk= github.com/consensys/compress v0.2.5/go.mod h1:pyM+ZXiNUh7/0+AUjUf9RKUM6vSH7T/fsn5LLS0j1Tk= -github.com/consensys/gnark-crypto v0.14.1-0.20250116204316-e7fd38b0a0a6 h1:P4DeR8HYfQGl4Vj6KEv0Eszcokroit/U1dRrUsgt+js= -github.com/consensys/gnark-crypto v0.14.1-0.20250116204316-e7fd38b0a0a6/go.mod h1:q9s22Y0WIHd9UCBfD+xGeW8wDJ7WAGZZpMrLFqzBzrQ= +github.com/consensys/gnark-crypto v0.15.0 h1:OXsWnhheHV59eXIzhL5OIexa/vqTK8wtRYQCtwfMDtY= +github.com/consensys/gnark-crypto v0.15.0/go.mod h1:Ke3j06ndtPTVvo++PhGNgvm+lgpLvzbcE2MqljY7diU= github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= @@ -271,8 +271,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= @@ -304,8 +304,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U= -golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -410,8 +410,8 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= -golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -462,8 +462,8 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= diff --git a/internal/generator/backend/template/zkpschemes/groth16/groth16.verify.go.tmpl b/internal/generator/backend/template/zkpschemes/groth16/groth16.verify.go.tmpl index 06abd155e7..24682c2b74 100644 --- a/internal/generator/backend/template/zkpschemes/groth16/groth16.verify.go.tmpl +++ b/internal/generator/backend/template/zkpschemes/groth16/groth16.verify.go.tmpl @@ -17,7 +17,6 @@ import ( {{- template "import_fr" . }} {{- template "import_pedersen" .}} {{- template "import_hash_to_field" . }} - "github.com/consensys/gnark-crypto/utils" "github.com/consensys/gnark/backend" "github.com/consensys/gnark/backend/solidity" "github.com/consensys/gnark/constraint" @@ -65,7 +64,7 @@ func Verify(proof *Proof, vk *VerifyingKey, publicWitness fr.Vector, opts ...bac maxNbPublicCommitted := 0 for _, s := range vk.PublicAndCommitmentCommitted { // iterate over commitments - maxNbPublicCommitted = utils.Max(maxNbPublicCommitted, len(s)) + maxNbPublicCommitted = max(maxNbPublicCommitted, len(s)) } commitmentsSerialized := make([]byte, len(vk.PublicAndCommitmentCommitted)*fr.Bytes) commitmentPrehashSerialized := make([]byte, curve.SizeOfG1AffineUncompressed+maxNbPublicCommitted*fr.Bytes) diff --git a/std/recursion/groth16/verifier.go b/std/recursion/groth16/verifier.go index 067158b441..77ace9073e 100644 --- a/std/recursion/groth16/verifier.go +++ b/std/recursion/groth16/verifier.go @@ -13,7 +13,6 @@ import ( fr_bn254 "github.com/consensys/gnark-crypto/ecc/bn254/fr" bw6761 "github.com/consensys/gnark-crypto/ecc/bw6-761" fr_bw6761 "github.com/consensys/gnark-crypto/ecc/bw6-761/fr" - "github.com/consensys/gnark-crypto/utils" "github.com/consensys/gnark/backend/groth16" groth16backend_bls12377 "github.com/consensys/gnark/backend/groth16/bls12-377" groth16backend_bls12381 "github.com/consensys/gnark/backend/groth16/bls12-381" @@ -635,7 +634,7 @@ func (v *Verifier[FR, G1El, G2El, GtEl]) AssertProof(vk VerifyingKey[G1El, G2El, maxNbPublicCommitted := 0 for _, s := range vk.PublicAndCommitmentCommitted { // iterate over commitments - maxNbPublicCommitted = utils.Max(maxNbPublicCommitted, len(s)) + maxNbPublicCommitted = max(maxNbPublicCommitted, len(s)) } commitmentAuxData := make([]*emulated.Element[FR], len(vk.PublicAndCommitmentCommitted))