Skip to content

Commit e78b332

Browse files
authored
BIP324: Fix features bitmask for decoding-case selection
1 parent 869fd77 commit e78b332

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bip-0324/gen_test_vectors.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ def ellswift_create_deterministic(seed, features):
9595
have_x1 = "valid_x(x1)" in flags
9696
have_x2 = "valid_x(x2)" in flags
9797
have_x3 = "valid_x(x3)" in flags
98-
if (features & 4) == 0 and not (have_x1 and not have_x2 and not have_x3):
98+
if (features & 3) == 0 and not (have_x1 and not have_x2 and not have_x3):
9999
continue
100-
if (features & 4) == 1 and not (not have_x1 and have_x2 and not have_x3):
100+
if (features & 3) == 1 and not (not have_x1 and have_x2 and not have_x3):
101101
continue
102-
if (features & 4) == 2 and not (not have_x1 and not have_x2 and have_x3):
102+
if (features & 3) == 2 and not (not have_x1 and not have_x2 and have_x3):
103103
continue
104-
if (features & 4) == 3 and not (have_x1 and have_x2 and have_x3):
104+
if (features & 3) == 3 and not (have_x1 and have_x2 and have_x3):
105105
continue
106106
return sec, u.to_bytes(32, 'big') + t.to_bytes()
107107

0 commit comments

Comments
 (0)