Skip to content

Commit

Permalink
musig: ensure point_load output is normalized
Browse files Browse the repository at this point in the history
This is similar to the upstream commit "Normalize ge produced from
secp256k1_pubkey_load".
  • Loading branch information
jonasnick committed Jul 25, 2023
1 parent 7a07f3d commit e593ed5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/modules/musig/keyagg_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ static void secp256k1_point_load(secp256k1_ge *ge, const unsigned char *data) {
} else {
/* Otherwise, fall back to 32-byte big endian for X and Y. */
secp256k1_fe x, y;
secp256k1_fe_set_b32_mod(&x, data);
secp256k1_fe_set_b32_mod(&y, data + 32);
int ret = 1;
ret &= secp256k1_fe_set_b32_limit(&x, data);
ret &= secp256k1_fe_set_b32_limit(&y, data + 32);
VERIFY_CHECK(ret);
secp256k1_ge_set_xy(ge, &x, &y);
}
}
Expand Down

0 comments on commit e593ed5

Please sign in to comment.