@@ -257,8 +257,12 @@ func fuzzCrossG1MultiExp(data []byte) int {
257
257
cp .MultiExp (gnarkPoints , gnarkScalars , ecc.MultiExpConfig {})
258
258
259
259
// compare result
260
- if ! (bytes .Equal (cp .Marshal (), g1 .ToBytes (& kp ))) {
261
- panic ("G1 multi exponentiation mismatch gnark / geth " )
260
+ gnarkRes := cp .Marshal ()
261
+ gethRes := g1 .ToBytes (& kp )
262
+ if ! bytes .Equal (gnarkRes , gethRes ) {
263
+ msg := fmt .Sprintf ("G1 multi exponentiation mismatch gnark/geth.\n gnark: %x\n geth: %x\n input: %x\n " ,
264
+ gnarkRes , gethRes , data )
265
+ panic (msg )
262
266
}
263
267
264
268
return 1
@@ -283,15 +287,18 @@ func getG1Points(input io.Reader) (*bls12381.PointG1, *gnark.G1Affine, *blst.P1A
283
287
if err != nil {
284
288
panic (fmt .Sprintf ("Could not marshal gnark.G1 -> geth.G1: %v" , err ))
285
289
}
286
- if ! bytes .Equal (g1 .ToBytes (kp ), cpBytes ) {
287
- panic ("bytes(gnark.G1) != bytes(geth.G1)" )
290
+
291
+ gnarkRes := g1 .ToBytes (kp )
292
+ if ! bytes .Equal (gnarkRes , cpBytes ) {
293
+ panic (fmt .Sprintf ("bytes(gnark.G1) != bytes(geth.G1)\n gnark.G1: %x\n geth.G1: %x\n " , gnarkRes , cpBytes ))
288
294
}
289
295
290
296
// marshal gnark point -> blst point
291
297
scalar := new (blst.Scalar ).FromBEndian (common .LeftPadBytes (s .Bytes (), 32 ))
292
298
p1 := new (blst.P1Affine ).From (scalar )
293
- if ! bytes .Equal (p1 .Serialize (), cpBytes ) {
294
- panic ("bytes(blst.G1) != bytes(geth.G1)" )
299
+ blstRes := p1 .Serialize ()
300
+ if ! bytes .Equal (blstRes , cpBytes ) {
301
+ panic (fmt .Sprintf ("bytes(blst.G1) != bytes(geth.G1)\n blst.G1: %x\n geth.G1: %x\n " , blstRes , cpBytes ))
295
302
}
296
303
297
304
return kp , cp , p1 , nil
@@ -316,8 +323,10 @@ func getG2Points(input io.Reader) (*bls12381.PointG2, *gnark.G2Affine, *blst.P2A
316
323
if err != nil {
317
324
panic (fmt .Sprintf ("Could not marshal gnark.G2 -> geth.G2: %v" , err ))
318
325
}
319
- if ! bytes .Equal (g2 .ToBytes (kp ), cpBytes ) {
320
- panic ("bytes(gnark.G2) != bytes(geth.G2)" )
326
+
327
+ gnarkRes := g2 .ToBytes (kp )
328
+ if ! bytes .Equal (gnarkRes , cpBytes ) {
329
+ panic (fmt .Sprintf ("bytes(gnark.G2) != bytes(geth.G2)\n gnark.G2: %x\n geth.G2: %x\n " , gnarkRes , cpBytes ))
321
330
}
322
331
323
332
// marshal gnark point -> blst point
0 commit comments