Skip to content

Commit

Permalink
Add test for secp256k1_fe_half
Browse files Browse the repository at this point in the history
  • Loading branch information
sipa authored and peterdettman committed Jan 31, 2022
1 parent 925f78d commit 9cc5c25
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -2548,6 +2548,14 @@ void run_field_misc(void) {
secp256k1_fe_add(&q, &x);
CHECK(check_fe_equal(&y, &z));
CHECK(check_fe_equal(&q, &y));
/* Check secp256k1_fe_half. */
z = x;
secp256k1_fe_half(&z);
secp256k1_fe_add(&z, &z);
CHECK(check_fe_equal(&x, &z));
secp256k1_fe_add(&z, &z);
secp256k1_fe_half(&z);
CHECK(check_fe_equal(&x, &z));
}
}

Expand Down

0 comments on commit 9cc5c25

Please sign in to comment.