@@ -2349,32 +2349,92 @@ def case16_fail_msm_G1():
2349
2349
"Name" : "bls_g1msm_empty_input"
2350
2350
},
2351
2351
{
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 ),
2353
2363
"ExpectedError" : "invalid input length" ,
2354
2364
"Name" : "bls_g1msm_short_input"
2355
2365
},
2356
2366
{
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 ),
2358
2378
"ExpectedError" : "invalid input length" ,
2359
2379
"Name" : "bls_g1msm_long_input"
2360
2380
},
2361
2381
{
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 ),
2363
2393
"ExpectedError" : "invalid fp.Element encoding" ,
2364
2394
"Name" : "bls_g1msm_invalid_field_element"
2365
2395
},
2366
2396
{
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 ),
2368
2408
"ExpectedError" : "invalid field element top bytes" ,
2369
2409
"Name" : "bls_g1msm_violate_top_bytes"
2370
2410
},
2371
2411
{
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 ),
2373
2423
"ExpectedError" : "invalid point: not on curve" ,
2374
2424
"Name" : "bls_g1msm_point_not_on_curve"
2375
2425
},
2376
2426
{
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 ),
2378
2438
"ExpectedError" : "g1 point is not in the correct subgroup" ,
2379
2439
"Name" : "bls_g1msm_g1_not_in_correct_subgroup"
2380
2440
}
0 commit comments