@@ -59,10 +59,8 @@ var allPrecompiles = map[libcommon.Address]PrecompiledContract{
59
59
libcommon .BytesToAddress ([]byte {8 }): & bn256PairingIstanbul {},
60
60
libcommon .BytesToAddress ([]byte {9 }): & blake2F {},
61
61
libcommon .BytesToAddress ([]byte {10 }): & bls12381G1Add {},
62
- libcommon .BytesToAddress ([]byte {11 }): & bls12381G1Mul {},
63
62
libcommon .BytesToAddress ([]byte {12 }): & bls12381G1MultiExp {},
64
63
libcommon .BytesToAddress ([]byte {13 }): & bls12381G2Add {},
65
- libcommon .BytesToAddress ([]byte {14 }): & bls12381G2Mul {},
66
64
libcommon .BytesToAddress ([]byte {15 }): & bls12381G2MultiExp {},
67
65
libcommon .BytesToAddress ([]byte {16 }): & bls12381Pairing {},
68
66
libcommon .BytesToAddress ([]byte {17 }): & bls12381MapFpToG1 {},
@@ -312,10 +310,8 @@ func benchJson(name, addr string, b *testing.B) {
312
310
}
313
311
314
312
func TestPrecompiledBLS12381G1Add (t * testing.T ) { testJson ("blsG1Add" , "0a" , t ) }
315
- func TestPrecompiledBLS12381G1Mul (t * testing.T ) { testJson ("blsG1Mul" , "0b" , t ) }
316
313
func TestPrecompiledBLS12381G1MultiExp (t * testing.T ) { testJson ("blsG1MultiExp" , "0c" , t ) }
317
314
func TestPrecompiledBLS12381G2Add (t * testing.T ) { testJson ("blsG2Add" , "0d" , t ) }
318
- func TestPrecompiledBLS12381G2Mul (t * testing.T ) { testJson ("blsG2Mul" , "0e" , t ) }
319
315
func TestPrecompiledBLS12381G2MultiExp (t * testing.T ) { testJson ("blsG2MultiExp" , "0f" , t ) }
320
316
func TestPrecompiledBLS12381Pairing (t * testing.T ) { testJson ("blsPairing" , "10" , t ) }
321
317
func TestPrecompiledBLS12381MapG1 (t * testing.T ) { testJson ("blsMapG1" , "11" , t ) }
@@ -326,48 +322,20 @@ func BenchmarkPrecompiledBLS12381G1Add(b *testing.B) { benchJson("blsG1Add"
326
322
func BenchmarkPrecompiledBLS12381G1Mul (b * testing.B ) { benchJson ("blsG1Mul" , "0b" , b ) }
327
323
func BenchmarkPrecompiledBLS12381G1MultiExp (b * testing.B ) { benchJson ("blsG1MultiExp" , "0c" , b ) }
328
324
func BenchmarkPrecompiledBLS12381G2Add (b * testing.B ) { benchJson ("blsG2Add" , "0d" , b ) }
329
- func BenchmarkPrecompiledBLS12381G2Mul (b * testing.B ) { benchJson ("blsG2Mul" , "0e" , b ) }
330
325
func BenchmarkPrecompiledBLS12381G2MultiExp (b * testing.B ) { benchJson ("blsG2MultiExp" , "0f" , b ) }
331
326
func BenchmarkPrecompiledBLS12381Pairing (b * testing.B ) { benchJson ("blsPairing" , "10" , b ) }
332
327
func BenchmarkPrecompiledBLS12381MapG1 (b * testing.B ) { benchJson ("blsMapG1" , "11" , b ) }
333
328
func BenchmarkPrecompiledBLS12381MapG2 (b * testing.B ) { benchJson ("blsMapG2" , "12" , b ) }
334
329
335
330
// Failure tests
336
331
func TestPrecompiledBLS12381G1AddFail (t * testing.T ) { testJsonFail ("blsG1Add" , "0a" , t ) }
337
- func TestPrecompiledBLS12381G1MulFail (t * testing.T ) { testJsonFail ("blsG1Mul" , "0b" , t ) }
338
332
func TestPrecompiledBLS12381G1MultiExpFail (t * testing.T ) { testJsonFail ("blsG1MultiExp" , "0c" , t ) }
339
333
func TestPrecompiledBLS12381G2AddFail (t * testing.T ) { testJsonFail ("blsG2Add" , "0d" , t ) }
340
- func TestPrecompiledBLS12381G2MulFail (t * testing.T ) { testJsonFail ("blsG2Mul" , "0e" , t ) }
341
334
func TestPrecompiledBLS12381G2MultiExpFail (t * testing.T ) { testJsonFail ("blsG2MultiExp" , "0f" , t ) }
342
335
func TestPrecompiledBLS12381PairingFail (t * testing.T ) { testJsonFail ("blsPairing" , "10" , t ) }
343
336
func TestPrecompiledBLS12381MapG1Fail (t * testing.T ) { testJsonFail ("blsMapG1" , "11" , t ) }
344
337
func TestPrecompiledBLS12381MapG2Fail (t * testing.T ) { testJsonFail ("blsMapG2" , "12" , t ) }
345
338
346
- // Tests from https://github.com/ethereum/EIPs/tree/master/assets/eip-2537
347
- func TestPrecompiledBLS12381G1AddEip (t * testing.T ) { testJson ("blsG1Add-eip" , "0a" , t ) }
348
- func TestPrecompiledBLS12381G1MulEip (t * testing.T ) { testJson ("blsG1Mul-eip" , "0b" , t ) }
349
- func TestPrecompiledBLS12381G1MultiExpEip (t * testing.T ) { testJson ("blsG1MultiExp-eip" , "0c" , t ) }
350
- func TestPrecompiledBLS12381G2AddEip (t * testing.T ) { testJson ("blsG2Add-eip" , "0d" , t ) }
351
- func TestPrecompiledBLS12381G2MulEip (t * testing.T ) { testJson ("blsG2Mul-eip" , "0e" , t ) }
352
- func TestPrecompiledBLS12381G2MultiExpEip (t * testing.T ) { testJson ("blsG2MultiExp-eip" , "0f" , t ) }
353
- func TestPrecompiledBLS12381PairingEip (t * testing.T ) { testJson ("blsPairing-eip" , "10" , t ) }
354
- func TestPrecompiledBLS12381MapG1Eip (t * testing.T ) { testJson ("blsMapG1-eip" , "11" , t ) }
355
- func TestPrecompiledBLS12381MapG2Eip (t * testing.T ) { testJson ("blsMapG2-eip" , "12" , t ) }
356
-
357
- func TestPrecompiledBLS12381G1AddFailEip (t * testing.T ) { testJsonFail ("blsG1Add-eip" , "0a" , t ) }
358
- func TestPrecompiledBLS12381G1MulFailEip (t * testing.T ) { testJsonFail ("blsG1Mul-eip" , "0b" , t ) }
359
- func TestPrecompiledBLS12381G1MultiExpFailEip (t * testing.T ) {
360
- testJsonFail ("blsG1MultiExp-eip" , "0c" , t )
361
- }
362
- func TestPrecompiledBLS12381G2AddFailEip (t * testing.T ) { testJsonFail ("blsG2Add-eip" , "0d" , t ) }
363
- func TestPrecompiledBLS12381G2MulFailEip (t * testing.T ) { testJsonFail ("blsG2Mul-eip" , "0e" , t ) }
364
- func TestPrecompiledBLS12381G2MultiExpFailEip (t * testing.T ) {
365
- testJsonFail ("blsG2MultiExp-eip" , "0f" , t )
366
- }
367
- func TestPrecompiledBLS12381PairingFailEip (t * testing.T ) { testJsonFail ("blsPairing-eip" , "10" , t ) }
368
- func TestPrecompiledBLS12381MapG1FailEip (t * testing.T ) { testJsonFail ("blsMapG1-eip" , "11" , t ) }
369
- func TestPrecompiledBLS12381MapG2FailEip (t * testing.T ) { testJsonFail ("blsMapG2-eip" , "12" , t ) }
370
-
371
339
func loadJson (name string ) ([]precompiledTest , error ) {
372
340
data , err := os .ReadFile (fmt .Sprintf ("testdata/precompiles/%v.json" , name ))
373
341
if err != nil {
@@ -439,6 +407,5 @@ func BenchmarkPrecompiledP256Verify(b *testing.B) {
439
407
440
408
func TestPrecompiledP256Verify (t * testing.T ) {
441
409
t .Parallel ()
442
-
443
410
testJson ("p256Verify" , "100" , t )
444
411
}
0 commit comments