Split fe_set_b32 into reducing and normalizing variants

This commit is contained in:
Pieter Wuille
2023-02-05 17:19:00 -05:00
parent 006ddc1f42
commit 5b32602295
16 changed files with 69 additions and 40 deletions

View File

@@ -239,7 +239,8 @@ static int secp256k1_ecdsa_sig_verify(const secp256k1_scalar *sigr, const secp25
}
#else
secp256k1_scalar_get_b32(c, sigr);
secp256k1_fe_set_b32(&xr, c);
/* we can ignore the fe_set_b32_limit return value, because we know the input is in range */
(void)secp256k1_fe_set_b32_limit(&xr, c);
/** We now have the recomputed R point in pr, and its claimed x coordinate (modulo n)
* in xr. Naively, we would extract the x coordinate from pr (requiring a inversion modulo p),