Skip to content

Commit

Permalink
tests: Initialize random group elements fully
Browse files Browse the repository at this point in the history
Summary:
Also fix add a missing comment.

This is a backport of secp56k1 [[bitcoin-core/secp256k1#814 | [[bitcoin-core/secp256k1#814 | PR814]]]]

Test Plan:
  ninja check-secp256k1

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D7613
  • Loading branch information
real-or-random authored and deadalnix committed Sep 28, 2020
1 parent 2dd4fda commit 8a99323
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/group.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ static int secp256k1_ge_is_infinity(const secp256k1_ge *a);
/** Check whether a group element is valid (i.e., on the curve). */
static int secp256k1_ge_is_valid_var(const secp256k1_ge *a);

/** Set r equal to the inverse of a (i.e., mirrored around the X axis) */
static void secp256k1_ge_neg(secp256k1_ge *r, const secp256k1_ge *a);

/** Set a group element equal to another which is given in jacobian coordinates */
Expand Down
1 change: 1 addition & 0 deletions src/tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ void random_group_element_test(secp256k1_ge *ge) {
break;
}
} while(1);
ge->infinity = 0;
}

void random_group_element_jacobian_test(secp256k1_gej *gej, const secp256k1_ge *ge) {
Expand Down

0 comments on commit 8a99323

Please sign in to comment.