From d3cb1f95eb74fd8e8c80cda5301b5d7bdee59fef Mon Sep 17 00:00:00 2001 From: Ben Woosley Date: Tue, 9 Oct 2018 15:40:37 +0900 Subject: [PATCH] Make use of TAG_PUBKEY constants in secp256k1_eckey_pubkey_parse This results in more self-documenting code. --- src/eckey_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eckey_impl.h b/src/eckey_impl.h index 1ab9a68..7c5b789 100644 --- a/src/eckey_impl.h +++ b/src/eckey_impl.h @@ -18,7 +18,7 @@ static int secp256k1_eckey_pubkey_parse(secp256k1_ge *elem, const unsigned char if (size == 33 && (pub[0] == SECP256K1_TAG_PUBKEY_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_ODD)) { secp256k1_fe x; return secp256k1_fe_set_b32(&x, pub+1) && secp256k1_ge_set_xo_var(elem, &x, pub[0] == SECP256K1_TAG_PUBKEY_ODD); - } else if (size == 65 && (pub[0] == 0x04 || pub[0] == 0x06 || pub[0] == 0x07)) { + } else if (size == 65 && (pub[0] == SECP256K1_TAG_PUBKEY_UNCOMPRESSED || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_EVEN || pub[0] == SECP256K1_TAG_PUBKEY_HYBRID_ODD)) { secp256k1_fe x, y; if (!secp256k1_fe_set_b32(&x, pub+1) || !secp256k1_fe_set_b32(&y, pub+33)) { return 0;