Make pubkey parsing test whether points are in the correct subgroup

This commit is contained in:
Pieter Wuille
2020-09-07 18:23:52 -07:00
parent 87af00b511
commit 08d7d89299
4 changed files with 38 additions and 0 deletions

View File

@@ -33,6 +33,9 @@ int secp256k1_xonly_pubkey_parse(const secp256k1_context* ctx, secp256k1_xonly_p
if (!secp256k1_ge_set_xo_var(&pk, &x, 0)) {
return 0;
}
if (!secp256k1_ge_is_in_correct_subgroup(&pk)) {
return 0;
}
secp256k1_xonly_pubkey_save(pubkey, &pk);
return 1;
}