Skip to content

Commit

Permalink
Always initialize output coordinates in secp256k1_ge_set_gej
Browse files Browse the repository at this point in the history
  • Loading branch information
sipa committed May 10, 2023
1 parent 3086cb9 commit a18821d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/group_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,11 @@ static void secp256k1_ge_set_gej(secp256k1_ge *r, secp256k1_gej *a) {

static void secp256k1_ge_set_gej_var(secp256k1_ge *r, secp256k1_gej *a) {
secp256k1_fe z2, z3;
if (a->infinity) {
if (secp256k1_gej_is_infinity(a)) {
secp256k1_ge_set_infinity(r);
return;
}
r->infinity = 0;
secp256k1_fe_inv_var(&a->z, &a->z);
secp256k1_fe_sqr(&z2, &a->z);
secp256k1_fe_mul(&z3, &a->z, &z2);
Expand Down

0 comments on commit a18821d

Please sign in to comment.