BIP324: Fix features bitmask for decoding-case selection #1969

pull phrwlk wants to merge 1 commits into bitcoin:master from phrwlk:Boban changing 1 files +4 −4
  1. phrwlk commented at 9:52 am on September 16, 2025: none
    Replace (features & 4) with (features & 3) in the four decoding-case checks. The docstring specifies that the lower two bits (f & 3) select which of x1/x2/x3 are valid. Using (features & 4) limited the value to {0,4}, making cases 1 and 2 unreachable and bypassing proper gating when bit 4 (u >= p) was set. This aligns implementation with the documented behavior and ensures all four modes are exercised correctly.
  2. BIP324: Fix features bitmask for decoding-case selection e78b33205b
  3. jonatack added the label Pending acceptance on Sep 17, 2025
  4. jonatack added the label Bug fix on Sep 17, 2025
  5. jonatack commented at 8:10 pm on September 17, 2025: member

    ACK e78b33205b8557efdf8a5c8ab931cda6e2b77599

    cc BIP authors @real-or-random @jonasschnelli @sipa @dhruv for sign-off

  6. real-or-random commented at 11:15 am on September 22, 2025: contributor
    I think that change is correct, but then this PR will also need to update the pregenerated packet_encoding_test_vectors.csv.
  7. jonatack added the label PR Author action required on Sep 23, 2025

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bips. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2025-10-12 05:10 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me