Skip to content

Commit 0281946

Browse files
committed
additional tests
1 parent 89301aa commit 0281946

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

main.py

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

209+
# Point in the correct subgroup but in the wrong curve
210+
# (isomorphic curve y^2 = x^3 + 24)
211+
G1_in_correct_subgroup_invalid_curve = (
212+
FQ(1563311815873081220285993675342141245310974220297818772030154712466505762317169118162528189777729008132203959344556),
213+
FQ(3236674100890915460738904118849163307977137634186030159846763358736164886129980111795846993376080270444574334963907)
214+
)
215+
209216

210217
PRIVKEYS = [
211218
hex_to_int('0x00000000000000000000000000000000263dbd792f5b1be47ed85f8938c0f29586af0d3ac7b977f21c278fe1462040e3'),
@@ -2195,6 +2202,16 @@ def case12_fail_mul_G1():
21952202
+ int_to_hex(int(2), 32),
21962203
"ExpectedError": "g1 point is not in the correct subgroup",
21972204
"Name": "bls_g1mul_g1_not_in_correct_subgroup"
2205+
},
2206+
{
2207+
"Input": ""
2208+
# G1 point (not in the correct subgroup)
2209+
+ int_to_hex(int(G1_in_correct_subgroup_invalid_curve[0]), 64)
2210+
+ int_to_hex(int(G1_in_correct_subgroup_invalid_curve[1]), 64)
2211+
# scalar
2212+
+ int_to_hex(int(2), 32),
2213+
"ExpectedError": "invalid point: not on curve",
2214+
"Name": "bls_g1mul_g1_in_correct_subgroup_invalid_curve"
21982215
}
21992216
]
22002217

0 commit comments

Comments
 (0)