File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 22
22
FP2_SIZE_IN_BYTES = 128
23
23
G1_SIZE_IN_BYTES = 128
24
24
G2_SIZE_IN_BYTES = 256
25
+ # Constant for parsing pairs of points during pairing check
26
+ G1_TO_G2_OFFSET = G1_SIZE_IN_BYTES + G2_SIZE_IN_BYTES
25
27
26
28
G1Point = Tuple [bls12_381 .FQ , bls12_381 .FQ ]
27
29
G2Point = Tuple [bls12_381 .FQ2 , bls12_381 .FQ2 ]
@@ -149,12 +151,10 @@ def g2_multiexp(computation: BaseComputation) -> BaseComputation:
149
151
150
152
def _pairing (input_data : bytes ) -> bool :
151
153
field_element = bls12_381 .FQ12 .one ()
152
- g1_to_g2_offset = G1_SIZE_IN_BYTES + G2_SIZE_IN_BYTES
153
154
for next_index in range (0 , len (input_data ), 384 ):
154
155
p = _parse_g1_point (input_data [next_index :next_index + G1_SIZE_IN_BYTES ])
155
-
156
156
q = _parse_g2_point (
157
- input_data [next_index + G1_SIZE_IN_BYTES :next_index + g1_to_g2_offset ]
157
+ input_data [next_index + G1_SIZE_IN_BYTES :next_index + G1_TO_G2_OFFSET ]
158
158
)
159
159
projective_p = (p [0 ], p [1 ], bls12_381 .FQ .one ())
160
160
projective_q = (q [0 ], q [1 ], bls12_381 .FQ2 .one ())
You can’t perform that action at this time.
0 commit comments