Skip to content

Commit

Permalink
tests/fuzzers: supply gnark multiexp config, fixes ethereum#26669
Browse files Browse the repository at this point in the history
  • Loading branch information
holiman committed Feb 13, 2023
1 parent 241cf62 commit 8eeb9a6
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{NbTasks: 1})

// compare result
if !(bytes.Equal(cp.Marshal(), g1.ToBytes(&kp))) {
Expand Down

0 comments on commit 8eeb9a6

Please sign in to comment.