bip-0327: add test vectors for cases no vector covers #2329

pull fametrano wants to merge 1 commits into bitcoin:master from fametrano:bip327-vectors changing 7 files +138 −7
  1. fametrano commented at 11:22 PM on October 10, 2026: contributor

    I implemented BIP327 independently in btclib-ecc (Python), and these are the cases my tests reach and the vectors do not. reference.py computes every new value, every new case is appended so no existing index changes, and btclib-ecc reproduces every case of the five changed files, with the same error messages.

    • det_sign: plain and x-only tweaks with a 38-byte message.
    • sign_verify: a 100-byte message; a single signer; a secnonce whose second half is zero; a secnonce generated for another signer's public key; fewer pubnonces than pubkeys at verification.
    • sig_agg: a single signer. gen_vectors_helper.py gains the case, so it still generates the file.
    • nonce_gen: an extra_in shorter than 32 bytes.
    • tweak: a 31-byte tweak; fewer is_xonly flags than tweaks.

    One case I left out: a secnonce whose second half is 1. reference.py accepts it, so it is not an error case, and every valid sign_verify case signs with secnonces[0]. Adding it would need a change to reference.py, such as a secnonce index in the valid cases. Would you want that?

    The changelog gets version 1.0.5.

    Assisted-by: my usual tools (LLM, Internet, computer). Mistakes are mine.

  2. bip-0327: add test vectors for cases no vector covers
    New cases:
    - one signer: nonce_agg of one nonce, sign, verify, sig_agg
    - a 100-byte message
    - a plain and an x-only tweak over a 38-byte message (det_sign)
    - an extra_in shorter than 32 bytes
    - a secnonce whose second half is zero
    - a secnonce generated for another signer's public key
    - fewer pubnonces than pubkeys at verify
    - fewer is_xonly flags than tweaks
    - a 31-byte tweak
    
    reference.py computed every value. The sig_agg case is generated by
    gen_vectors_helper.py, which now includes it.
    
    Assisted-by: my usual tools (LLM, Internet, computer). Mistakes are mine.
    Signed-off-by: Ferdinando Ametrano <ferdinando@ametrano.net>
    b449b07ad6
Contributors

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: 2026-10-14 03:10 UTC

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