secp256k1 icon indicating copy to clipboard operation
secp256k1 copied to clipboard

Preconditions of fe_equal_var are weaker than documented

Open real-or-random opened this issue 4 years ago • 1 comments

From IRC:

<roconnor> The documentation for secp256k1_fe_equal_var suggest both inputs have to have magnitude 1; however only the first input needs to have magnitude 1. <roconnor> thus this call to fe_normalize_weak could be eliminated. <roconnor> But it is so very not critical, I'm not sure it is even worth PRing. <real_or_random> roconnor: same thing happens in secp256k1_gej_eq_x_var which is used in ECDSA verification. but ok, the speedup is still negligible <real_or_random> but I believe it's worth a PR (or an issue) because it would improve the internal docs

real-or-random avatar May 14 '21 18:05 real-or-random

https://github.com/bitcoin-core/secp256k1/blob/1e78c18d5b80552d15aa2e2e58348fc1b89b1e3b/src/group_impl.h#L264 is the call to fe_normalize_weak I had in mind, but @real-or-random has another instance somewhere else.

roconnor-blockstream avatar May 15 '21 14:05 roconnor-blockstream