From 03585ed7a932a6002569c382ab1d3b8d62819b07 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Mon, 13 Feb 2023 08:14:34 -0500 Subject: [PATCH] tests/fuzzers: supply gnark multiexp config, fixes #26669 (#26670) This change fixes a fuzzer which broke when we updated the gnark dependency earlier. --- tests/fuzzers/bls12381/bls12381_fuzz.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/fuzzers/bls12381/bls12381_fuzz.go b/tests/fuzzers/bls12381/bls12381_fuzz.go index a5b4b9e79..ced87dd41 100644 --- a/tests/fuzzers/bls12381/bls12381_fuzz.go +++ b/tests/fuzzers/bls12381/bls12381_fuzz.go @@ -26,6 +26,7 @@ import ( "io" "math/big" + "github.com/consensys/gnark-crypto/ecc" gnark "github.com/consensys/gnark-crypto/ecc/bls12-381" "github.com/consensys/gnark-crypto/ecc/bls12-381/fp" "github.com/consensys/gnark-crypto/ecc/bls12-381/fr" @@ -198,7 +199,7 @@ func FuzzCrossG1MultiExp(data []byte) int { } gethScalars = append(gethScalars, s) var gnarkScalar = &fr.Element{} - gnarkScalar = gnarkScalar.SetBigInt(s).FromMont() + gnarkScalar = gnarkScalar.SetBigInt(s) gnarkScalars = append(gnarkScalars, *gnarkScalar) gethPoints = append(gethPoints, new(bls12381.PointG1).Set(kp1)) @@ -217,7 +218,7 @@ func FuzzCrossG1MultiExp(data []byte) int { // gnark multi exp cp := new(gnark.G1Affine) - cp.MultiExp(gnarkPoints, gnarkScalars) + cp.MultiExp(gnarkPoints, gnarkScalars, ecc.MultiExpConfig{}) // compare result if !(bytes.Equal(cp.Marshal(), g1.ToBytes(&kp))) {