Skip to content

Commit 4da7cf7

Browse files
committed
renaming
1 parent d1493e1 commit 4da7cf7

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

main.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def compress_G2(pt: G2Uncompressed) -> G2Compressed:
195195

196196

197197
# Point not in subgroup (order 13) for curve over FQ2
198-
G2_wrong_order = (
198+
G2_not_in_correct_subgroup = (
199199
FQ2([
200200
3922397287649913227621058437622997108794641953057758105879357683864299671651819357275859520733535654147680406731276,
201201
3741137028670202333708729730342450399205516524855163427388600406129033394826520864962370018146369072778910602014330
@@ -428,7 +428,7 @@ def case02_add_G2():
428428
result_comm1 = add(G2, P2)
429429
result_comm2 = add(P2, G2)
430430
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)
432432
# Identity element
433433
result_identity_G2 = add(G2, None)
434434
assert G2 == result_identity_G2
@@ -482,17 +482,17 @@ def case02_add_G2():
482482
{
483483
"Input": ""
484484
# 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)
489489
# G2 point
490490
+ int_to_hex(int(G2[0].coeffs[0]), 64)
491491
+ int_to_hex(int(G2[0].coeffs[1]), 64)
492492
+ int_to_hex(int(G2[1].coeffs[0]), 64)
493493
+ 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),
496496
"Gas": BLS12_G2ADD_GAS,
497497
"NoBenchmark": False
498498
},
@@ -2269,10 +2269,10 @@ def case13_fail_mul_G2():
22692269
{
22702270
"Input": ""
22712271
# 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)
22762276
# scalar
22772277
+ int_to_hex(int(2), 32),
22782278
"ExpectedError": "g2 point is not in the correct subgroup",
@@ -2546,10 +2546,10 @@ def case17_fail_msm_G2():
25462546
{
25472547
"Input": ""
25482548
# 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)
25532553
# scalar
25542554
+ int_to_hex(int(2), 32)
25552555
# P2 point
@@ -2843,10 +2843,10 @@ def case18_fail_pairing_check():
28432843
# G1 point (point at infinity)
28442844
+ int_to_hex(0, 128)
28452845
# 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),
28502850
"ExpectedError": "g2 point is not in the correct subgroup",
28512851
"Name": "bls_pairing_e(0,G2_not_in_correct_subgroup)",
28522852
},
@@ -2869,10 +2869,10 @@ def case18_fail_pairing_check():
28692869
+ int_to_hex(int(G1[0]), 64)
28702870
+ int_to_hex(int(G1[1]), 64)
28712871
# 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),
28762876
"ExpectedError": "g2 point is not in the correct subgroup",
28772877
"Name": "bls_pairing_e(G1,G2_not_in_correct_subgroup)",
28782878
},
@@ -2903,10 +2903,10 @@ def case18_fail_pairing_check():
29032903
+ int_to_hex(int(G1[0]), 64)
29042904
+ int_to_hex(int(G1[1]), 64)
29052905
# 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)
29102910
# G1 point 2
29112911
+ int_to_hex(int(G1[0]), 64)
29122912
+ int_to_hex(int(G1[1]), 64)

0 commit comments

Comments
 (0)