Implement subtraction operator for GE class in BIP-0374 reference code #1779

pull VolodymyrBg wants to merge 2 commits into bitcoin:master from VolodymyrBg:AE5959595959 changing 2 files +7 −3
  1. VolodymyrBg commented at 3:19 pm on March 2, 2025: none

    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.

  2. Update reference.py 1434c8b49c
  3. Update secp256k1.py 4628087b35
  4. jonatack added the label Proposed BIP modification on Mar 10, 2025
  5. jonatack added the label Pending acceptance on Mar 10, 2025
  6. jonatack commented at 9:00 pm on March 10, 2025: member

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: 2025-03-29 07:10 UTC

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