1
0
mirror of https://github.com/bitcoin/bips.git synced 2025-05-12 12:03:29 +00:00
bips/bip-0374
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
..