Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/modules/extrakeys/main_impl.h
Show All 27 Lines | int secp256k1_xonly_pubkey_parse(const secp256k1_context* ctx, secp256k1_xonly_pubkey *pubkey, const unsigned char *input32) { | ||||
ARG_CHECK(input32 != NULL); | ARG_CHECK(input32 != NULL); | ||||
if (!secp256k1_fe_set_b32(&x, input32)) { | if (!secp256k1_fe_set_b32(&x, input32)) { | ||||
return 0; | return 0; | ||||
} | } | ||||
if (!secp256k1_ge_set_xo_var(&pk, &x, 0)) { | if (!secp256k1_ge_set_xo_var(&pk, &x, 0)) { | ||||
return 0; | return 0; | ||||
} | } | ||||
if (!secp256k1_ge_is_in_correct_subgroup(&pk)) { | |||||
return 0; | |||||
} | |||||
secp256k1_xonly_pubkey_save(pubkey, &pk); | secp256k1_xonly_pubkey_save(pubkey, &pk); | ||||
return 1; | return 1; | ||||
} | } | ||||
int secp256k1_xonly_pubkey_serialize(const secp256k1_context* ctx, unsigned char *output32, const secp256k1_xonly_pubkey *pubkey) { | int secp256k1_xonly_pubkey_serialize(const secp256k1_context* ctx, unsigned char *output32, const secp256k1_xonly_pubkey *pubkey) { | ||||
secp256k1_ge pk; | secp256k1_ge pk; | ||||
VERIFY_CHECK(ctx != NULL); | VERIFY_CHECK(ctx != NULL); | ||||
▲ Show 20 Lines • Show All 205 Lines • Show Last 20 Lines |