Add fe_half tests for worst-case inputs

- Add field method _fe_get_bounds
This commit is contained in:
Peter Dettman
2021-12-23 16:41:10 +07:00
parent 4eb8b932ff
commit d64bb5d4f3
4 changed files with 89 additions and 0 deletions

View File

@@ -135,4 +135,8 @@ static void secp256k1_fe_cmov(secp256k1_fe *r, const secp256k1_fe *a, int flag);
* The output is not guaranteed to be normalized, regardless of the input. */
static void secp256k1_fe_half(secp256k1_fe *r);
/** Sets each limb of 'r' to its upper bound at magnitude 'm'. The output will also have its
* magnitude set to 'm' and is normalized if (and only if) 'm' is zero. */
static void secp256k1_fe_get_bounds(secp256k1_fe *r, int m);
#endif /* SECP256K1_FIELD_H */