Skip to content

Commit

Permalink
tests/fuzzers: supply gnark multiexp config, fixes #26669 (#26670)
Browse files Browse the repository at this point in the history
This change fixes a fuzzer which broke when we updated the gnark dependency earlier.
  • Loading branch information
holiman authored Feb 13, 2023
1 parent 7d29fff commit 03585ed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/fuzzers/bls12381/bls12381_fuzz.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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))
Expand All @@ -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))) {
Expand Down

0 comments on commit 03585ed

Please sign in to comment.