@@ -195,7 +195,7 @@ def compress_G2(pt: G2Uncompressed) -> G2Compressed:
195
195
196
196
197
197
# Point not in subgroup (order 13) for curve over FQ2
198
- G2_wrong_order = (
198
+ G2_not_in_correct_subgroup = (
199
199
FQ2 ([
200
200
3922397287649913227621058437622997108794641953057758105879357683864299671651819357275859520733535654147680406731276 ,
201
201
3741137028670202333708729730342450399205516524855163427388600406129033394826520864962370018146369072778910602014330
@@ -428,7 +428,7 @@ def case02_add_G2():
428
428
result_comm1 = add (G2 , P2 )
429
429
result_comm2 = add (P2 , G2 )
430
430
assert result_comm1 == result_comm2
431
- result_add_wrong_order = add (G2_wrong_order , G2 )
431
+ result_add_not_in_correct_subgroup = add (G2_not_in_correct_subgroup , G2 )
432
432
# Identity element
433
433
result_identity_G2 = add (G2 , None )
434
434
assert G2 == result_identity_G2
@@ -482,17 +482,17 @@ def case02_add_G2():
482
482
{
483
483
"Input" : ""
484
484
# G2 point (wrong order)
485
- + int_to_hex (int (G2_wrong_order [0 ].coeffs [0 ]), 64 )
486
- + int_to_hex (int (G2_wrong_order [0 ].coeffs [1 ]), 64 )
487
- + int_to_hex (int (G2_wrong_order [1 ].coeffs [0 ]), 64 )
488
- + int_to_hex (int (G2_wrong_order [1 ].coeffs [1 ]), 64 )
485
+ + int_to_hex (int (G2_not_in_correct_subgroup [0 ].coeffs [0 ]), 64 )
486
+ + int_to_hex (int (G2_not_in_correct_subgroup [0 ].coeffs [1 ]), 64 )
487
+ + int_to_hex (int (G2_not_in_correct_subgroup [1 ].coeffs [0 ]), 64 )
488
+ + int_to_hex (int (G2_not_in_correct_subgroup [1 ].coeffs [1 ]), 64 )
489
489
# G2 point
490
490
+ int_to_hex (int (G2 [0 ].coeffs [0 ]), 64 )
491
491
+ int_to_hex (int (G2 [0 ].coeffs [1 ]), 64 )
492
492
+ int_to_hex (int (G2 [1 ].coeffs [0 ]), 64 )
493
493
+ int_to_hex (int (G2 [1 ].coeffs [1 ]), 64 ),
494
- "Name" : "bls_g2add_g2_wrong_order +g2" ,
495
- "Expected" : int_to_hex (int (result_add_wrong_order [0 ].coeffs [0 ]), 64 ) + int_to_hex (int (result_add_wrong_order [0 ].coeffs [1 ]), 64 ) + int_to_hex (int (result_add_wrong_order [1 ].coeffs [0 ]), 64 ) + int_to_hex (int (result_add_wrong_order [1 ].coeffs [1 ]), 64 ),
494
+ "Name" : "bls_g2add_g2_not_in_correct_subgroup +g2" ,
495
+ "Expected" : int_to_hex (int (result_add_not_in_correct_subgroup [0 ].coeffs [0 ]), 64 ) + int_to_hex (int (result_add_not_in_correct_subgroup [0 ].coeffs [1 ]), 64 ) + int_to_hex (int (result_add_not_in_correct_subgroup [1 ].coeffs [0 ]), 64 ) + int_to_hex (int (result_add_not_in_correct_subgroup [1 ].coeffs [1 ]), 64 ),
496
496
"Gas" : BLS12_G2ADD_GAS ,
497
497
"NoBenchmark" : False
498
498
},
@@ -2269,10 +2269,10 @@ def case13_fail_mul_G2():
2269
2269
{
2270
2270
"Input" : ""
2271
2271
# G2 point (not in the correct subgroup)
2272
- + int_to_hex (int (G2_wrong_order [0 ].coeffs [0 ]), 64 )
2273
- + int_to_hex (int (G2_wrong_order [0 ].coeffs [1 ]), 64 )
2274
- + int_to_hex (int (G2_wrong_order [1 ].coeffs [0 ]), 64 )
2275
- + int_to_hex (int (G2_wrong_order [1 ].coeffs [1 ]), 64 )
2272
+ + int_to_hex (int (G2_not_in_correct_subgroup [0 ].coeffs [0 ]), 64 )
2273
+ + int_to_hex (int (G2_not_in_correct_subgroup [0 ].coeffs [1 ]), 64 )
2274
+ + int_to_hex (int (G2_not_in_correct_subgroup [1 ].coeffs [0 ]), 64 )
2275
+ + int_to_hex (int (G2_not_in_correct_subgroup [1 ].coeffs [1 ]), 64 )
2276
2276
# scalar
2277
2277
+ int_to_hex (int (2 ), 32 ),
2278
2278
"ExpectedError" : "g2 point is not in the correct subgroup" ,
@@ -2546,10 +2546,10 @@ def case17_fail_msm_G2():
2546
2546
{
2547
2547
"Input" : ""
2548
2548
# G2 point (not in the correct subgroup)
2549
- + int_to_hex (int (G2_wrong_order [0 ].coeffs [0 ]), 64 )
2550
- + int_to_hex (int (G2_wrong_order [0 ].coeffs [1 ]), 64 )
2551
- + int_to_hex (int (G2_wrong_order [1 ].coeffs [0 ]), 64 )
2552
- + int_to_hex (int (G2_wrong_order [1 ].coeffs [1 ]), 64 )
2549
+ + int_to_hex (int (G2_not_in_correct_subgroup [0 ].coeffs [0 ]), 64 )
2550
+ + int_to_hex (int (G2_not_in_correct_subgroup [0 ].coeffs [1 ]), 64 )
2551
+ + int_to_hex (int (G2_not_in_correct_subgroup [1 ].coeffs [0 ]), 64 )
2552
+ + int_to_hex (int (G2_not_in_correct_subgroup [1 ].coeffs [1 ]), 64 )
2553
2553
# scalar
2554
2554
+ int_to_hex (int (2 ), 32 )
2555
2555
# P2 point
@@ -2843,10 +2843,10 @@ def case18_fail_pairing_check():
2843
2843
# G1 point (point at infinity)
2844
2844
+ int_to_hex (0 , 128 )
2845
2845
# G2 point (not on curve)
2846
- + int_to_hex (int (G2_wrong_order [0 ].coeffs [0 ]), 64 )
2847
- + int_to_hex (int (G2_wrong_order [0 ].coeffs [1 ]), 64 )
2848
- + int_to_hex (int (G2_wrong_order [1 ].coeffs [0 ]), 64 )
2849
- + int_to_hex (int (G2_wrong_order [1 ].coeffs [1 ]), 64 ),
2846
+ + int_to_hex (int (G2_not_in_correct_subgroup [0 ].coeffs [0 ]), 64 )
2847
+ + int_to_hex (int (G2_not_in_correct_subgroup [0 ].coeffs [1 ]), 64 )
2848
+ + int_to_hex (int (G2_not_in_correct_subgroup [1 ].coeffs [0 ]), 64 )
2849
+ + int_to_hex (int (G2_not_in_correct_subgroup [1 ].coeffs [1 ]), 64 ),
2850
2850
"ExpectedError" : "g2 point is not in the correct subgroup" ,
2851
2851
"Name" : "bls_pairing_e(0,G2_not_in_correct_subgroup)" ,
2852
2852
},
@@ -2869,10 +2869,10 @@ def case18_fail_pairing_check():
2869
2869
+ int_to_hex (int (G1 [0 ]), 64 )
2870
2870
+ int_to_hex (int (G1 [1 ]), 64 )
2871
2871
# G2 point (not on curve)
2872
- + int_to_hex (int (G2_wrong_order [0 ].coeffs [0 ]), 64 )
2873
- + int_to_hex (int (G2_wrong_order [0 ].coeffs [1 ]), 64 )
2874
- + int_to_hex (int (G2_wrong_order [1 ].coeffs [0 ]), 64 )
2875
- + int_to_hex (int (G2_wrong_order [1 ].coeffs [1 ]), 64 ),
2872
+ + int_to_hex (int (G2_not_in_correct_subgroup [0 ].coeffs [0 ]), 64 )
2873
+ + int_to_hex (int (G2_not_in_correct_subgroup [0 ].coeffs [1 ]), 64 )
2874
+ + int_to_hex (int (G2_not_in_correct_subgroup [1 ].coeffs [0 ]), 64 )
2875
+ + int_to_hex (int (G2_not_in_correct_subgroup [1 ].coeffs [1 ]), 64 ),
2876
2876
"ExpectedError" : "g2 point is not in the correct subgroup" ,
2877
2877
"Name" : "bls_pairing_e(G1,G2_not_in_correct_subgroup)" ,
2878
2878
},
@@ -2903,10 +2903,10 @@ def case18_fail_pairing_check():
2903
2903
+ int_to_hex (int (G1 [0 ]), 64 )
2904
2904
+ int_to_hex (int (G1 [1 ]), 64 )
2905
2905
# G2 point 1 (not in the correct subgroup)
2906
- + int_to_hex (int (G2_wrong_order [0 ].coeffs [0 ]), 64 )
2907
- + int_to_hex (int (G2_wrong_order [0 ].coeffs [1 ]), 64 )
2908
- + int_to_hex (int (G2_wrong_order [1 ].coeffs [0 ]), 64 )
2909
- + int_to_hex (int (G2_wrong_order [1 ].coeffs [1 ]), 64 )
2906
+ + int_to_hex (int (G2_not_in_correct_subgroup [0 ].coeffs [0 ]), 64 )
2907
+ + int_to_hex (int (G2_not_in_correct_subgroup [0 ].coeffs [1 ]), 64 )
2908
+ + int_to_hex (int (G2_not_in_correct_subgroup [1 ].coeffs [0 ]), 64 )
2909
+ + int_to_hex (int (G2_not_in_correct_subgroup [1 ].coeffs [1 ]), 64 )
2910
2910
# G1 point 2
2911
2911
+ int_to_hex (int (G1 [0 ]), 64 )
2912
2912
+ int_to_hex (int (G1 [1 ]), 64 )
0 commit comments