|
|
@ -26,6 +26,7 @@ import ( |
|
|
|
"io" |
|
|
|
"io" |
|
|
|
"math/big" |
|
|
|
"math/big" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/consensys/gnark-crypto/ecc" |
|
|
|
gnark "github.com/consensys/gnark-crypto/ecc/bls12-381" |
|
|
|
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/fp" |
|
|
|
"github.com/consensys/gnark-crypto/ecc/bls12-381/fr" |
|
|
|
"github.com/consensys/gnark-crypto/ecc/bls12-381/fr" |
|
|
@ -198,7 +199,7 @@ func FuzzCrossG1MultiExp(data []byte) int { |
|
|
|
} |
|
|
|
} |
|
|
|
gethScalars = append(gethScalars, s) |
|
|
|
gethScalars = append(gethScalars, s) |
|
|
|
var gnarkScalar = &fr.Element{} |
|
|
|
var gnarkScalar = &fr.Element{} |
|
|
|
gnarkScalar = gnarkScalar.SetBigInt(s).FromMont() |
|
|
|
gnarkScalar = gnarkScalar.SetBigInt(s) |
|
|
|
gnarkScalars = append(gnarkScalars, *gnarkScalar) |
|
|
|
gnarkScalars = append(gnarkScalars, *gnarkScalar) |
|
|
|
|
|
|
|
|
|
|
|
gethPoints = append(gethPoints, new(bls12381.PointG1).Set(kp1)) |
|
|
|
gethPoints = append(gethPoints, new(bls12381.PointG1).Set(kp1)) |
|
|
@ -217,7 +218,7 @@ func FuzzCrossG1MultiExp(data []byte) int { |
|
|
|
|
|
|
|
|
|
|
|
// gnark multi exp
|
|
|
|
// gnark multi exp
|
|
|
|
cp := new(gnark.G1Affine) |
|
|
|
cp := new(gnark.G1Affine) |
|
|
|
cp.MultiExp(gnarkPoints, gnarkScalars) |
|
|
|
cp.MultiExp(gnarkPoints, gnarkScalars, ecc.MultiExpConfig{}) |
|
|
|
|
|
|
|
|
|
|
|
// compare result
|
|
|
|
// compare result
|
|
|
|
if !(bytes.Equal(cp.Marshal(), g1.ToBytes(&kp))) { |
|
|
|
if !(bytes.Equal(cp.Marshal(), g1.ToBytes(&kp))) { |
|
|
|