Skip to content

Commit 1e699fa

Browse files
committed
improving formatting
1 parent 6a5f7b4 commit 1e699fa

File tree

1 file changed

+66
-6
lines changed

1 file changed

+66
-6
lines changed

main.py

Lines changed: 66 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2349,32 +2349,92 @@ def case16_fail_msm_G1():
23492349
"Name": "bls_g1msm_empty_input"
23502350
},
23512351
{
2352-
"Input": int_to_hex(int(G1[0]), 63) + (int_to_hex(int(G1[1]), 64)) + int_to_hex(int(2), 32) + int_to_hex(int(P1[0]), 64) + (int_to_hex(int(P1[1]), 64)) + int_to_hex(int(2), 32),
2352+
"Input": ""
2353+
# G1 point (short x coordinate)
2354+
+ int_to_hex(int(G1[0]), 63)
2355+
+ int_to_hex(int(G1[1]), 64)
2356+
# scalar
2357+
+ int_to_hex(int(2), 32)
2358+
# P1 point
2359+
+ int_to_hex(int(P1[0]), 64)
2360+
+ int_to_hex(int(P1[1]), 64)
2361+
# scalar
2362+
+ int_to_hex(int(2), 32),
23532363
"ExpectedError": "invalid input length",
23542364
"Name": "bls_g1msm_short_input"
23552365
},
23562366
{
2357-
"Input": int_to_hex(int(G1[0]), 65) + (int_to_hex(int(G1[1]), 64)) + int_to_hex(int(2), 32) + int_to_hex(int(P1[0]), 64) + (int_to_hex(int(P1[1]), 64)) + int_to_hex(int(2), 32),
2367+
"Input": ""
2368+
# G1 point (long x coordinate)
2369+
+ int_to_hex(int(G1[0]), 65)
2370+
+ int_to_hex(int(G1[1]), 64)
2371+
# scalar
2372+
+ int_to_hex(int(2), 32)
2373+
# P1 point
2374+
+ int_to_hex(int(P1[0]), 64)
2375+
+ int_to_hex(int(P1[1]), 64)
2376+
# scalar
2377+
+ int_to_hex(int(2), 32),
23582378
"ExpectedError": "invalid input length",
23592379
"Name": "bls_g1msm_long_input"
23602380
},
23612381
{
2362-
"Input": int_to_hex(int(G1[0]) + q, 64) + (int_to_hex(int(G1[1]), 64)) + int_to_hex(int(2), 32) + int_to_hex(int(P1[0]), 64) + (int_to_hex(int(P1[1]), 64)) + int_to_hex(int(2), 32),
2382+
"Input": ""
2383+
# G1 point (wrong encoding)
2384+
+ int_to_hex(int(G1[0]) + q, 64)
2385+
+ int_to_hex(int(G1[1]), 64)
2386+
# scalar
2387+
+ int_to_hex(int(2), 32)
2388+
# P1 point
2389+
+ int_to_hex(int(P1[0]), 64)
2390+
+ int_to_hex(int(P1[1]), 64)
2391+
# scalar
2392+
+ int_to_hex(int(2), 32),
23632393
"ExpectedError": "invalid fp.Element encoding",
23642394
"Name": "bls_g1msm_invalid_field_element"
23652395
},
23662396
{
2367-
"Input": "10" + int_to_hex(int(G1[0]), 63) + (int_to_hex(int(G1[1]), 64)) + int_to_hex(int(2), 32) + int_to_hex(int(P1[0]), 64) + (int_to_hex(int(P1[1]), 64)) + int_to_hex(int(2), 32),
2397+
# G1 point (wrong element top bytes)
2398+
"Input": "10"
2399+
+ int_to_hex(int(G1[0]), 63)
2400+
+ int_to_hex(int(G1[1]), 64)
2401+
# scalar
2402+
+ int_to_hex(int(2), 32)
2403+
# P1 point
2404+
+ int_to_hex(int(P1[0]), 64)
2405+
+ int_to_hex(int(P1[1]), 64)
2406+
# scalar
2407+
+ int_to_hex(int(2), 32),
23682408
"ExpectedError": "invalid field element top bytes",
23692409
"Name": "bls_g1msm_violate_top_bytes"
23702410
},
23712411
{
2372-
"Input": int_to_hex(int(G1[0]), 64) + (int_to_hex(int(P1[1]), 64)) + int_to_hex(int(2), 32) + int_to_hex(int(P1[0]), 64) + (int_to_hex(int(P1[1]), 64)) + int_to_hex(int(2), 32),
2412+
"Input": ""
2413+
# G1 point (not on curve)
2414+
+ int_to_hex(int(G1[0]), 64)
2415+
+ int_to_hex(int(P1[1]), 64)
2416+
# scalar
2417+
+ int_to_hex(int(2), 32)
2418+
# P1 point
2419+
+ int_to_hex(int(P1[0]), 64)
2420+
+ int_to_hex(int(P1[1]), 64)
2421+
# scalar
2422+
+ int_to_hex(int(2), 32),
23732423
"ExpectedError": "invalid point: not on curve",
23742424
"Name": "bls_g1msm_point_not_on_curve"
23752425
},
23762426
{
2377-
"Input": int_to_hex(int(G1_wrong_order[0]), 64) + (int_to_hex(int(G1_wrong_order[1]), 64)) + int_to_hex(int(2), 32) + int_to_hex(int(P1[0]), 64) + (int_to_hex(int(P1[1]), 64)) + int_to_hex(int(2), 32),
2427+
"Input": ""
2428+
# G1 point (not in the correct subgroup)
2429+
+ int_to_hex(int(G1_wrong_order[0]), 64)
2430+
+ int_to_hex(int(G1_wrong_order[1]), 64)
2431+
# scalar
2432+
+ int_to_hex(int(2), 32)
2433+
# P1 point
2434+
+ int_to_hex(int(P1[0]), 64)
2435+
+ int_to_hex(int(P1[1]), 64)
2436+
# scalar
2437+
+ int_to_hex(int(2), 32),
23782438
"ExpectedError": "g1 point is not in the correct subgroup",
23792439
"Name": "bls_g1msm_g1_not_in_correct_subgroup"
23802440
}

0 commit comments

Comments
 (0)