BIP-340: fix lift_x calls in test vector generation script #1729

pull theStack wants to merge 1 commits into bitcoin:master from theStack:fix-bip0340-test-vector-gen_lift_x changing 1 files +12 −11
  1. theStack commented at 2:24 pm on December 20, 2024: contributor

    The lift_x function in the BIP and the reference implementation expect an integer to be passed rather than a byte array.

    Can be tested with:

    0$ python3 test-vectors.py > expected.csv
    1$ diff test-vectors.csv expected.csv
    

    On master, the first call fails with

     0Traceback (most recent call last):
     1  File "/home/thestack/bips/bip-0340/test-vectors.py", line 267, in <module>
     2    vector0(),
     3    ^^^^^^^^^
     4  File "/home/thestack/bips/bip-0340/test-vectors.py", line 30, in vector0
     5    pubkey_point = lift_x(pubkey)
     6                   ^^^^^^^^^^^^^^
     7  File "/home/thestack/bips/bip-0340/reference.py", line 72, in lift_x
     8    if x >= p:
     9       ^^^^^^
    10TypeError: '>=' not supported between instances of 'bytes' and 'int'
    
  2. BIP-340: fix `lift_x` calls in test vector generation script
    The `lift_x` function in the BIP and the reference implementation
    expect an integer to be passed rather than a byte array.
    
    Can be tested with:
    ```
    $ python3 test-vectors.py > expected.csv
    $ diff test-vectors.csv expected.csv
    ```
    7d921e3314
  3. murchandamus added the label Proposed BIP modification on Dec 20, 2024
  4. murchandamus added the label Pending acceptance on Dec 20, 2024
  5. murchandamus added the label Bug fix on Dec 20, 2024
  6. murchandamus commented at 3:21 pm on December 20, 2024: contributor
  7. real-or-random approved
  8. real-or-random commented at 3:35 pm on December 20, 2024: contributor

    utACK 7d921e33148bac865ef84860f61a3a2eba233c7d This was apparently overlooked in 3998dbbc8a3ab3bfabb1b2e90a4840ad93a84adb

    Thanks!

  9. jonasnick approved
  10. jonasnick commented at 7:48 pm on December 23, 2024: contributor

    ACK 7d921e33148bac865ef84860f61a3a2eba233c7d

    Thanks @theStack

  11. murchandamus merged this on Dec 23, 2024
  12. murchandamus closed this on Dec 23, 2024

  13. murchandamus removed the label Pending acceptance on Dec 23, 2024
  14. murchandamus removed the label Bug fix on Dec 23, 2024
  15. murchandamus added the label Bug fix on Dec 23, 2024
  16. theStack deleted the branch on Dec 23, 2024
  17. murchandamus removed the label Proposed BIP modification on Dec 27, 2024

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: 2024-12-30 17:10 UTC

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