Skip to content

Commit

Permalink
Verify that secp256k1_ge_set_gej_zinv does not operate on infinity.
Browse files Browse the repository at this point in the history
a->x and a->y should not be used if the infinity flag is set.
  • Loading branch information
roconnor-blockstream committed Dec 3, 2021
1 parent fecf436 commit 6c0be85
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/group_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ static const secp256k1_fe secp256k1_fe_const_b = SECP256K1_FE_CONST(0, 0, 0, 0,
static void secp256k1_ge_set_gej_zinv(secp256k1_ge *r, const secp256k1_gej *a, const secp256k1_fe *zi) {
secp256k1_fe zi2;
secp256k1_fe zi3;
VERIFY_CHECK(!a->infinity);
secp256k1_fe_sqr(&zi2, zi);
secp256k1_fe_mul(&zi3, &zi2, zi);
secp256k1_fe_mul(&r->x, &a->x, &zi2);
Expand Down

0 comments on commit 6c0be85

Please sign in to comment.