According to the comment above, wouldn't it be better to have the check r &= (a->magnitude = 1 || a->magnitude = 0);? Instead of the ones below.
Stronger magnitude check for normalized field element in `_fe_verify` #1059
issue siv2r opened this issue on January 2, 2022-
siv2r commented at 6:52 AM on January 2, 2022: contributor
-
siv2r commented at 6:57 AM on January 2, 2022: contributor
My bad, I forgot that
a->magnitudeis anint. - siv2r closed this on Jan 2, 2022
-
real-or-random commented at 11:13 AM on January 2, 2022: contributor
Well, I think because it is
int, it would make sense to exclude negative values. But we already to this here (not conditioned onnormalized): https://github.com/bitcoin-core/secp256k1/blob/a1102b12196ea27f44d6201de4d25926a2ae9640/src/field_10x26_impl.h#L37
Contributors