use new _eckey_pubkey_serialize{33,65} functions in public API
This commit is contained in:
@@ -280,10 +280,14 @@ int secp256k1_ec_pubkey_serialize(const secp256k1_context* ctx, unsigned char *o
|
||||
ARG_CHECK(pubkey != NULL);
|
||||
ARG_CHECK((flags & SECP256K1_FLAGS_TYPE_MASK) == SECP256K1_FLAGS_TYPE_COMPRESSION);
|
||||
if (secp256k1_pubkey_load(ctx, &Q, pubkey)) {
|
||||
ret = secp256k1_eckey_pubkey_serialize(&Q, output, &len, !!(flags & SECP256K1_FLAGS_BIT_COMPRESSION));
|
||||
if (ret) {
|
||||
*outputlen = len;
|
||||
if (flags & SECP256K1_FLAGS_BIT_COMPRESSION) {
|
||||
secp256k1_eckey_pubkey_serialize33(&Q, output);
|
||||
*outputlen = 33;
|
||||
} else {
|
||||
secp256k1_eckey_pubkey_serialize65(&Q, output);
|
||||
*outputlen = 65;
|
||||
}
|
||||
ret = 1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user