schnorrsig: Optimize negation in verification #1830

pull real-or-random wants to merge 1 commits into bitcoin-core:master from real-or-random:202602-schnorr-verify-negate changing 2 files +5 −5
  1. real-or-random commented at 12:35 pm on February 27, 2026: contributor

    This trades a scalar negation for a group (= field) negation. This is admittedly more for fun because the actual improvement is hardly noticeable, but since it’s in signature verification, I couldn’t resist.

    In fact, we could store the xonly pubkey as odd when we parse it, and save the negation entirely, but this adds complexity and I leave this to the next crazy contributor.

  2. schnorrsig: Optimize negation in verification
    This trades a scalar negation for a group (= field) negation. This is
    admittedly more for fun because the actual improvement is hardly
    noticeable, but since it's in signature verification, I couldn't resist.
    
    In fact, we could store the xonly pubkey as odd when we parse it, and
    save the negation entirely, but this adds complexity and I leave this to
    the next crazy contributor.
    003765c483
  3. real-or-random added the label performance on Feb 27, 2026
  4. real-or-random added the label tweak/refactor on Feb 27, 2026
  5. real-or-random commented at 1:03 pm on February 27, 2026: contributor

    scalar_neg takes about 2 ns on my laptop. fe_neg is much faster.

    But damn, while I’m writing this I noticed that I overlooked the fe_normalize_weak call in gej_neg… Well, we could save that one in many cases, but this will add complexity, too. Nevermind.

  6. real-or-random closed this on Feb 27, 2026


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-03-04 02:15 UTC

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