@@ -61,14 +61,12 @@ var allPrecompiles = map[common.Address]PrecompiledContract{
6161 common .BytesToAddress ([]byte {0x01 , 0x00 }): & p256Verify {},
6262
6363 common .BytesToAddress ([]byte {0x0f , 0x0a }): & bls12381G1Add {},
64- common .BytesToAddress ([]byte {0x0f , 0x0b }): & bls12381G1Mul {},
65- common .BytesToAddress ([]byte {0x0f , 0x0c }): & bls12381G1MultiExp {},
66- common .BytesToAddress ([]byte {0x0f , 0x0d }): & bls12381G2Add {},
67- common .BytesToAddress ([]byte {0x0f , 0x0e }): & bls12381G2Mul {},
68- common .BytesToAddress ([]byte {0x0f , 0x0f }): & bls12381G2MultiExp {},
69- common .BytesToAddress ([]byte {0x0f , 0x10 }): & bls12381Pairing {},
70- common .BytesToAddress ([]byte {0x0f , 0x11 }): & bls12381MapG1 {},
71- common .BytesToAddress ([]byte {0x0f , 0x12 }): & bls12381MapG2 {},
64+ common .BytesToAddress ([]byte {0x0f , 0x0b }): & bls12381G1MultiExp {},
65+ common .BytesToAddress ([]byte {0x0f , 0x0c }): & bls12381G2Add {},
66+ common .BytesToAddress ([]byte {0x0f , 0x0d }): & bls12381G2MultiExp {},
67+ common .BytesToAddress ([]byte {0x0f , 0x0e }): & bls12381Pairing {},
68+ common .BytesToAddress ([]byte {0x0f , 0x0f }): & bls12381MapG1 {},
69+ common .BytesToAddress ([]byte {0x0f , 0x10 }): & bls12381MapG2 {},
7270}
7371
7472// EIP-152 test vectors
@@ -308,38 +306,36 @@ func benchJson(name, addr string, b *testing.B) {
308306
309307func TestPrecompiledBLS12381G1Add (t * testing.T ) { testJson ("blsG1Add" , "f0a" , t ) }
310308func TestPrecompiledBLS12381G1Mul (t * testing.T ) { testJson ("blsG1Mul" , "f0b" , t ) }
311- func TestPrecompiledBLS12381G1MultiExp (t * testing.T ) { testJson ("blsG1MultiExp" , "f0c " , t ) }
312- func TestPrecompiledBLS12381G2Add (t * testing.T ) { testJson ("blsG2Add" , "f0d " , t ) }
313- func TestPrecompiledBLS12381G2Mul (t * testing.T ) { testJson ("blsG2Mul" , "f0e " , t ) }
314- func TestPrecompiledBLS12381G2MultiExp (t * testing.T ) { testJson ("blsG2MultiExp" , "f0f " , t ) }
315- func TestPrecompiledBLS12381Pairing (t * testing.T ) { testJson ("blsPairing" , "f10 " , t ) }
316- func TestPrecompiledBLS12381MapG1 (t * testing.T ) { testJson ("blsMapG1" , "f11 " , t ) }
317- func TestPrecompiledBLS12381MapG2 (t * testing.T ) { testJson ("blsMapG2" , "f12 " , t ) }
309+ func TestPrecompiledBLS12381G1MultiExp (t * testing.T ) { testJson ("blsG1MultiExp" , "f0b " , t ) }
310+ func TestPrecompiledBLS12381G2Add (t * testing.T ) { testJson ("blsG2Add" , "f0c " , t ) }
311+ func TestPrecompiledBLS12381G2Mul (t * testing.T ) { testJson ("blsG2Mul" , "f0d " , t ) }
312+ func TestPrecompiledBLS12381G2MultiExp (t * testing.T ) { testJson ("blsG2MultiExp" , "f0d " , t ) }
313+ func TestPrecompiledBLS12381Pairing (t * testing.T ) { testJson ("blsPairing" , "f0e " , t ) }
314+ func TestPrecompiledBLS12381MapG1 (t * testing.T ) { testJson ("blsMapG1" , "f0f " , t ) }
315+ func TestPrecompiledBLS12381MapG2 (t * testing.T ) { testJson ("blsMapG2" , "f10 " , t ) }
318316
319317func TestPrecompiledPointEvaluation (t * testing.T ) { testJson ("pointEvaluation" , "0a" , t ) }
320318
321319func BenchmarkPrecompiledPointEvaluation (b * testing.B ) { benchJson ("pointEvaluation" , "0a" , b ) }
322320
323321func BenchmarkPrecompiledBLS12381G1Add (b * testing.B ) { benchJson ("blsG1Add" , "f0a" , b ) }
324- func BenchmarkPrecompiledBLS12381G1Mul (b * testing.B ) { benchJson ("blsG1Mul" , "f0b" , b ) }
325- func BenchmarkPrecompiledBLS12381G1MultiExp (b * testing.B ) { benchJson ("blsG1MultiExp" , "f0c" , b ) }
326- func BenchmarkPrecompiledBLS12381G2Add (b * testing.B ) { benchJson ("blsG2Add" , "f0d" , b ) }
327- func BenchmarkPrecompiledBLS12381G2Mul (b * testing.B ) { benchJson ("blsG2Mul" , "f0e" , b ) }
328- func BenchmarkPrecompiledBLS12381G2MultiExp (b * testing.B ) { benchJson ("blsG2MultiExp" , "f0f" , b ) }
329- func BenchmarkPrecompiledBLS12381Pairing (b * testing.B ) { benchJson ("blsPairing" , "f10" , b ) }
330- func BenchmarkPrecompiledBLS12381MapG1 (b * testing.B ) { benchJson ("blsMapG1" , "f11" , b ) }
331- func BenchmarkPrecompiledBLS12381MapG2 (b * testing.B ) { benchJson ("blsMapG2" , "f12" , b ) }
322+ func BenchmarkPrecompiledBLS12381G1MultiExp (b * testing.B ) { benchJson ("blsG1MultiExp" , "f0b" , b ) }
323+ func BenchmarkPrecompiledBLS12381G2Add (b * testing.B ) { benchJson ("blsG2Add" , "f0c" , b ) }
324+ func BenchmarkPrecompiledBLS12381G2MultiExp (b * testing.B ) { benchJson ("blsG2MultiExp" , "f0d" , b ) }
325+ func BenchmarkPrecompiledBLS12381Pairing (b * testing.B ) { benchJson ("blsPairing" , "f0e" , b ) }
326+ func BenchmarkPrecompiledBLS12381MapG1 (b * testing.B ) { benchJson ("blsMapG1" , "f0f" , b ) }
327+ func BenchmarkPrecompiledBLS12381MapG2 (b * testing.B ) { benchJson ("blsMapG2" , "f10" , b ) }
332328
333329// Failure tests
334330func TestPrecompiledBLS12381G1AddFail (t * testing.T ) { testJsonFail ("blsG1Add" , "f0a" , t ) }
335331func TestPrecompiledBLS12381G1MulFail (t * testing.T ) { testJsonFail ("blsG1Mul" , "f0b" , t ) }
336- func TestPrecompiledBLS12381G1MultiExpFail (t * testing.T ) { testJsonFail ("blsG1MultiExp" , "f0c " , t ) }
337- func TestPrecompiledBLS12381G2AddFail (t * testing.T ) { testJsonFail ("blsG2Add" , "f0d " , t ) }
338- func TestPrecompiledBLS12381G2MulFail (t * testing.T ) { testJsonFail ("blsG2Mul" , "f0e " , t ) }
339- func TestPrecompiledBLS12381G2MultiExpFail (t * testing.T ) { testJsonFail ("blsG2MultiExp" , "f0f " , t ) }
340- func TestPrecompiledBLS12381PairingFail (t * testing.T ) { testJsonFail ("blsPairing" , "f10 " , t ) }
341- func TestPrecompiledBLS12381MapG1Fail (t * testing.T ) { testJsonFail ("blsMapG1" , "f11 " , t ) }
342- func TestPrecompiledBLS12381MapG2Fail (t * testing.T ) { testJsonFail ("blsMapG2" , "f12 " , t ) }
332+ func TestPrecompiledBLS12381G1MultiExpFail (t * testing.T ) { testJsonFail ("blsG1MultiExp" , "f0b " , t ) }
333+ func TestPrecompiledBLS12381G2AddFail (t * testing.T ) { testJsonFail ("blsG2Add" , "f0c " , t ) }
334+ func TestPrecompiledBLS12381G2MulFail (t * testing.T ) { testJsonFail ("blsG2Mul" , "f0d " , t ) }
335+ func TestPrecompiledBLS12381G2MultiExpFail (t * testing.T ) { testJsonFail ("blsG2MultiExp" , "f0d " , t ) }
336+ func TestPrecompiledBLS12381PairingFail (t * testing.T ) { testJsonFail ("blsPairing" , "f0e " , t ) }
337+ func TestPrecompiledBLS12381MapG1Fail (t * testing.T ) { testJsonFail ("blsMapG1" , "f0f " , t ) }
338+ func TestPrecompiledBLS12381MapG2Fail (t * testing.T ) { testJsonFail ("blsMapG2" , "f10 " , t ) }
343339
344340func loadJson (name string ) ([]precompiledTest , error ) {
345341 data , err := os .ReadFile (fmt .Sprintf ("testdata/precompiles/%v.json" , name ))
0 commit comments