Skip to content

Commit cf8668f

Browse files
committed
bppp: Fix test for invalid sign byte again
The first byte provided to secp256k1_bppp_parse_one_of_points is allowed to be 0, 1, 2, or 3 since it encodes the Y coordinate of two points. In a previous fix we wrongly assumed it can only be 2 or 3.
1 parent b2ccc8d commit cf8668f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/modules/bppp/tests_impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ static void test_serialize_two_points(void) {
257257
random_group_element_test(&R);
258258
secp256k1_bppp_serialize_points(buf, &X, &R);
259259

260-
buf[0] = 4 + (unsigned char)secp256k1_testrandi64(0, 253);
260+
buf[0] = (unsigned char)secp256k1_testrandi64(4, 255);
261261
/* Assert that buf[0] is actually invalid. */
262262
CHECK(buf[0] != 0x02 && buf[0] != 0x03);
263263

0 commit comments

Comments
 (0)