1
0
mirror of https://github.com/bitcoin/bips.git synced 2025-05-12 12:03:29 +00:00

12 Commits

Author SHA1 Message Date
Tronica
6ceafc51b1
BIP-0374: fix incorrect bit index and modernize CSV reader usage in test vector scripts (#1817)
* Update run_test_vectors.py

* Update gen_test_vectors.py

* Regenerate test vectors after fixing message tampering logic in gen_test_vectors.py
2025-04-16 07:10:16 -07:00
VolodymyrBg
7c80a699ff Implement subtraction operator for GE class in BIP-0374 reference code
This commit implements the subtraction operator (sub) for the GE (Group Element) class in the secp256k1.py file as requested in the TODO comment in reference.py.

The implementation is straightforward, leveraging the existing neg method to define subtraction as addition with the negated element: self + (-a).

After implementing the operator, the code in reference.py was simplified by replacing expressions like:
s * G + (-e * A) with s * G - e * A

This makes the code more readable and directly matches the mathematical notation used in the BIP-0374 specification.

Co-Authored-By: Sebastian Falbesoner <sebastian.falbesoner@gmail.com>
2025-04-15 14:39:09 +03:00
Andrew Toth
24b4354e64
BIP374: Add message to rand computation (#1758)
* BIP374: Add message to rand computation

* BIP374: Update reference and test vectors

* Add changelog

* Format changelog according to BIP3

* Add creation date

Co-authored-by: Jon Atack <jon@atack.com>

* Grammar fix

Co-authored-by: Jon Atack <jon@atack.com>

* update changelog

---------

Co-authored-by: Jon Atack <jon@atack.com>
2025-02-27 08:37:46 -08:00
stratospher
5f42eb64d4 BIP374: add test vector for optional message
- added 1 more successful test vectors.
  now there are 8 test vectors[test vectors 0..7].
- test vector 5 has optional message
- test vectors 5, 6, 7 have G=GENERATOR
2025-01-28 06:40:58 +05:30
stratospher
41e0f34f76 BIP374: add test vectors for secp256k1 generator point
- added 2 more successful test vectors.
  now there are 7 test vectors[test vectors 0..6].
- test vectors 5, 6 have G=GENERATOR
2025-01-27 14:20:45 +05:30
Jon Atack
b15a0a1aa9
Merge pull request #1736 from jonatack/2024-12-bip374-make-python-files-executable
BIP374: update reference.py and secp256k1.py to be executable
2025-01-01 16:04:57 -08:00
Sebastian Falbesoner
a00064fcfa BIP-374: add generated test vector .csv files 2024-12-30 17:19:55 +01:00
Jon Atack
cce668de3c bip374: update secp256k1.py to be executable 2024-12-28 18:20:56 -07:00
Jon Atack
a261439d92 bip374: update reference.py to be executable 2024-12-28 18:20:33 -07:00
Oliver Gugger
e141b9501d
bip-0374: remove default value for G in dleq_challenge
To avoid the mistake fixed in the previous commit, we remove the default
value from the G parameter of dleq_challenge.
2024-12-28 21:42:07 +01:00
Oliver Gugger
8bc42a2673
bip-0374: fix challenge generation, use correct G
Both generating and verifying a proof allows for specifying a custom
generator point G. But that custom generator point was not passed into
the dleq_challenge function, resulting in the default (secp256k1)
generator point to be used. This lead to the test vectors being
incorrect.
2024-12-28 15:58:08 +01:00
Andrew Toth
cb3afee850
Move test vectors to bip-0374 directory, add tests for G 2024-12-26 14:17:52 -05:00