Skip to content

Commit

Permalink
Merge bitcoin-core/secp256k1#1283: Get rid of secp256k1_fe_const_b
Browse files Browse the repository at this point in the history
69e1ec0 Get rid of secp256k1_fe_const_b (Pieter Wuille)

Pull request description:

  Replaces bitcoin#1282.

  Its only remaining use is in a test introduced in bitcoin#1118, and it is easily replaced by the new `secp256k1_fe_add_int` from bitcoin#1217.

ACKs for top commit:
  real-or-random:
    utACK 69e1ec0

Tree-SHA512: 6ada192e0643fc5326198b60f019a5081444f9ba0a5b8ba6236f2a526829d8e5e479556600a604d9bc96c7ba86e3aab813f93c66679287d2135e95a2b75f5d3e
  • Loading branch information
real-or-random committed Apr 21, 2023
2 parents 5ec1333 + 69e1ec0 commit f6bef03
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/group_impl.h
Expand Up @@ -73,8 +73,6 @@ static const secp256k1_ge secp256k1_ge_const_g = SECP256K1_G;
#endif
/* End of section generated by sage/gen_exhaustive_groups.sage. */

static const secp256k1_fe secp256k1_fe_const_b = SECP256K1_FE_CONST(0, 0, 0, 0, 0, 0, 0, SECP256K1_B);

static void secp256k1_ge_set_gej_zinv(secp256k1_ge *r, const secp256k1_gej *a, const secp256k1_fe *zi) {
secp256k1_fe zi2;
secp256k1_fe zi3;
Expand Down
2 changes: 1 addition & 1 deletion src/tests.c
Expand Up @@ -4498,7 +4498,7 @@ static void ecmult_const_mult_xonly(void) {
random_field_element_test(&x);
secp256k1_fe_sqr(&c, &x);
secp256k1_fe_mul(&c, &c, &x);
secp256k1_fe_add(&c, &secp256k1_fe_const_b);
secp256k1_fe_add_int(&c, SECP256K1_B);
} while (secp256k1_fe_is_square_var(&c));
/* If i is odd, n=d*x for random non-zero d. */
if (i & 1) {
Expand Down

0 comments on commit f6bef03

Please sign in to comment.