@@ -14,9 +14,20 @@ from ethereum.prague.vm.precompiled_contracts.ecrecover import ecrecover
14
14
from ethereum.prague.vm.precompiled_contracts.blake2f import blake2f
15
15
from ethereum.prague.vm.precompiled_contracts.point_evaluation import point_evaluation
16
16
from ethereum.prague.vm.precompiled_contracts.ripemd160 import ripemd160
17
+ from ethereum.prague.vm.precompiled_contracts.bls12_381.bls12_381_g1 import (
18
+ bls12_g1_add,
19
+ bls12_g1_msm,
20
+ bls12_map_fp_to_g1,
21
+ )
22
+ from ethereum.prague.vm.precompiled_contracts.bls12_381.bls12_381_g2 import (
23
+ bls12_g2_add,
24
+ bls12_g2_msm,
25
+ bls12_map_fp2_to_g2,
26
+ )
27
+ from ethereum.prague.vm.precompiled_contracts.bls12_381.bls12_381_pairing import bls12_pairing
17
28
from cairo_core.control_flow import raise
18
- // currently 10 precompiles.
19
- const N_PRECOMPILES = 10 ;
29
+ // currently 17 precompiles.
30
+ const N_PRECOMPILES = 17 ;
20
31
const HIGHEST_PRECOMPILE_LEADING_BYTE = 0x0a ;
21
32
22
33
// count 3 steps per index: precompile_address, call, precompile_fn
@@ -104,6 +115,20 @@ func precompile_table_lookup{range_check_ptr}(address: felt) -> (felt, felt) {
104
115
call blake2f; // BLAKE2F
105
116
dw 0xa00000000000000000000000000000000000000 ;
106
117
call point_evaluation; // POINT_EVALUATION
118
+ dw 0xb00000000000000000000000000000000000000 ;
119
+ call bls12_g1_add; // BLS12_G1ADD
120
+ dw 0xc00000000000000000000000000000000000000 ;
121
+ call bls12_g1_msm; // BLS12_G1MSM
122
+ dw 0xd00000000000000000000000000000000000000 ;
123
+ call bls12_g2_add; // BLS12_G2ADD
124
+ dw 0xe00000000000000000000000000000000000000 ;
125
+ call bls12_g2_msm; // BLS12_G2MSM
126
+ dw 0xf00000000000000000000000000000000000000 ;
127
+ call bls12_pairing; // BLS12_PAIRING_CHECK
128
+ dw 0x100000000000000000000000000000000000000 ;
129
+ call bls12_map_fp_to_g1; // BLS12_MAP_FP_TO_G1
130
+ dw 0x110000000000000000000000000000000000000 ;
131
+ call bls12_map_fp2_to_g2; // BLS12_MAP_FP2_TO_G2
107
132
// not reached.
108
133
ret ;
109
134
}
0 commit comments