Skip to content

Infinity handling: ecmult_const(infinity) works, and group verification#1299

Merged
real-or-random merged 6 commits intobitcoin-core:masterfrom
sipa:202306_pr791
May 10, 2023
Merged

Infinity handling: ecmult_const(infinity) works, and group verification#1299
real-or-random merged 6 commits intobitcoin-core:masterfrom
sipa:202306_pr791

Conversation

@sipa
Copy link
Copy Markdown
Contributor

@sipa sipa commented May 9, 2023

Rebase of #791.

  • Clean up infinity handling, make x/y/z always initialized for infinity.
  • Make secp256k1_ecmult_const handle infinity.
    • Infinity isn't currently needed here, but correctly handling it is a little more safe against future changes.
    • Update docs for it to make it clear that it is not constant time in Q. It never was constant time in Q (and would be a little complicated to make constant time in Q: needs a constant time addition function that tracks RZR). It isn't typical for ECDH to be constant time in terms of the pubkey. If it was later made constant time in Q infinity support would be easy to preserve, e.g. by running it on a dummy value and cmoving infinity into the output.
  • Add group verification (secp256k1_ge_verify and secp256k1_gej_verify, mimicking secp256k1_fe_verify).
  • Make the secp256k1_{fe,ge,gej}_verify functions also defined (as no-ops) in non-VERIFY mode.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants