Skip to content

Commit aac0ec9

Browse files
committed
Normalize ge produced from secp256k1_pubkey_load
The output ge is normalized when sizeof(secp256k1_ge_storage) = 64 but not when it's not 64. ARG_CHECK at the end of the function assumes normalization. So normalize ge in the other code path too.
1 parent 67214f5 commit aac0ec9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/secp256k1.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,8 @@ static int secp256k1_pubkey_load(const secp256k1_context* ctx, secp256k1_ge* ge,
249249
secp256k1_fe x, y;
250250
secp256k1_fe_set_b32_mod(&x, pubkey->data);
251251
secp256k1_fe_set_b32_mod(&y, pubkey->data + 32);
252+
secp256k1_fe_normalize_var(&x);
253+
secp256k1_fe_normalize_var(&y);
252254
secp256k1_ge_set_xy(ge, &x, &y);
253255
}
254256
ARG_CHECK(!secp256k1_fe_is_zero(&ge->x));

0 commit comments

Comments
 (0)