← Back to Bitcoin Improvement Proposals
BIPinformationalscript

BIP-0374: fix incorrect bit index and modernize CSV reader usage in test vector scripts

- **Corrected a logic bug in `gen_test_vectors.py`** Previously, the message tampering logic mistakenly used the proof damage index (`proof_damage_pos`) instead of the correct message index (`msg_damage_pos`). This could result in ineffective or misleading bit-flip tests. Now fixed to use the correct index for tampering the message. - **Modernized usage of `csv.reader` in `run_test_vectors.py`** Replaced the outdated `reader.__next__()` with the idiomatic and Python 3–safe `next(rea

No reviews
Pronoss·Updated Apr 16, 2025·0 reviews·0 attestations·View source
Collections:BIPs — Merged

Specification

  • Corrected a logic bug in gen_test_vectors.py
    Previously, the message tampering logic mistakenly used the proof damage index (proof_damage_pos) instead of the correct message index (msg_damage_pos). This could result in ineffective or misleading bit-flip tests.
    Now fixed to use the correct index for tampering the message.

  • Modernized usage of csv.reader in run_test_vectors.py
    Replaced the outdated reader.__next__() with the idiomatic and Python 3–safe next(reader) call for skipping headers.

Discussion (0 threads)

Loading discussions...