From d51f2dcaeb69473f0199ad8daf36eee3b1ceb1b5 Mon Sep 17 00:00:00 2001 From: phrwlk Date: Tue, 16 Sep 2025 12:52:35 +0300 Subject: [PATCH] BIP324: Fix features bitmask for decoding-case selection --- bip-0324/gen_test_vectors.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bip-0324/gen_test_vectors.py b/bip-0324/gen_test_vectors.py index 05b30a83..a9f4de5b 100644 --- a/bip-0324/gen_test_vectors.py +++ b/bip-0324/gen_test_vectors.py @@ -95,13 +95,13 @@ def ellswift_create_deterministic(seed, features): have_x1 = "valid_x(x1)" in flags have_x2 = "valid_x(x2)" in flags have_x3 = "valid_x(x3)" in flags - if (features & 4) == 0 and not (have_x1 and not have_x2 and not have_x3): + if (features & 3) == 0 and not (have_x1 and not have_x2 and not have_x3): continue - if (features & 4) == 1 and not (not have_x1 and have_x2 and not have_x3): + if (features & 3) == 1 and not (not have_x1 and have_x2 and not have_x3): continue - if (features & 4) == 2 and not (not have_x1 and not have_x2 and have_x3): + if (features & 3) == 2 and not (not have_x1 and not have_x2 and have_x3): continue - if (features & 4) == 3 and not (have_x1 and have_x2 and have_x3): + if (features & 3) == 3 and not (have_x1 and have_x2 and have_x3): continue return sec, u.to_bytes(32, 'big') + t.to_bytes()