Skip to content

Commit 495c616

Browse files
committed
additional tests
1 parent 0281946 commit 495c616

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

main.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ def compress_G2(pt: G2Uncompressed) -> G2Compressed:
206206
])
207207
)
208208

209-
# Point in the correct subgroup but in the wrong curve
209+
# Point in the correct subgroup but in the invalid curve
210210
# (isomorphic curve y^2 = x^3 + 24)
211211
G1_in_correct_subgroup_invalid_curve = (
212212
FQ(1563311815873081220285993675342141245310974220297818772030154712466505762317169118162528189777729008132203959344556),
@@ -2047,7 +2047,18 @@ def case10_fail_add_G1():
20472047
+ int_to_hex(int(P1[1]), 64),
20482048
"ExpectedError": "invalid field element top bytes",
20492049
"Name": "bls_g1add_violate_top_bytes"
2050-
}
2050+
},
2051+
{
2052+
"Input": ""
2053+
# G1 point (not in correct subgroup but invalid curve)
2054+
+ int_to_hex(int(G1_in_correct_subgroup_invalid_curve[0]), 64)
2055+
+ int_to_hex(int(G1_in_correct_subgroup_invalid_curve[1]), 64)
2056+
# P1 point
2057+
+ int_to_hex(int(P1[0]), 64)
2058+
+ int_to_hex(int(P1[1]), 64),
2059+
"ExpectedError": "invalid point: not on curve",
2060+
"Name": "bls_g1add_point_in_correct_subgroup_invalid_curve"
2061+
},
20512062
]
20522063

20532064

@@ -2205,7 +2216,7 @@ def case12_fail_mul_G1():
22052216
},
22062217
{
22072218
"Input": ""
2208-
# G1 point (not in the correct subgroup)
2219+
# G1 point (not in correct subgroup but invalid curve)
22092220
+ int_to_hex(int(G1_in_correct_subgroup_invalid_curve[0]), 64)
22102221
+ int_to_hex(int(G1_in_correct_subgroup_invalid_curve[1]), 64)
22112222
# scalar

0 commit comments

Comments
 (0)