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>
* 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>
* Correct type error in sample JSON
* first pass: moar data
* more fiat and edits
* more edits
* add per-txn value
* Update bip-0329.mediawiki
Co-authored-by: Jon Atack <jon@atack.com>
* Update bip-0329.mediawiki
Co-authored-by: Jon Atack <jon@atack.com>
* Update bip-0329.mediawiki
Co-authored-by: Jon Atack <jon@atack.com>
* Update bip-0329.mediawiki
Co-authored-by: Jon Atack <jon@atack.com>
* Update bip-0329.mediawiki
Co-authored-by: Jon Atack <jon@atack.com>
* Update bip-0329.mediawiki
Co-authored-by: Jon Atack <jon@atack.com>
* Update bip-0329.mediawiki
Co-authored-by: Jon Atack <jon@atack.com>
* Update bip-0329.mediawiki
Co-authored-by: Jon Atack <jon@atack.com>
* edit
* include @craigraw feedback
* typo fix
* add comment
* further edits
* broaden uses for address.heights
---------
Co-authored-by: Jon Atack <jon@atack.com>
Although the variant "implementor" predominated for much of the late 20th
century, today "implementer" is considered standard, and the former spelling
triggers the typos spelling checker.
Assuming a by one increment in the keytype of the silent payments output
fields, the following numeral to 0x09 in the hexadecimal system is 0x0a,
not 0x10.
- 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