Add unit tests for scalars.

Also add a secp256k1_scalar_is_one function.
This commit is contained in:
Pieter Wuille
2014-10-29 00:35:38 -07:00
parent eca6cdb123
commit 79359302fb
3 changed files with 268 additions and 0 deletions

View File

@@ -45,6 +45,9 @@ void static secp256k1_scalar_negate(secp256k1_scalar_t *r, const secp256k1_scala
/** Check whether a scalar equals zero. */
int static secp256k1_scalar_is_zero(const secp256k1_scalar_t *a);
/** Check whether a scalar equals one. */
int static secp256k1_scalar_is_one(const secp256k1_scalar_t *a);
/** Check whether a scalar is higher than the group order divided by 2. */
int static secp256k1_scalar_is_high(const secp256k1_scalar_t *a);