Merge commits '115b135f c8206b1c b6c2a3cd e7f7083b be5e4f02 5c751833 540fec8a aa2a39c1 8d445730 f9a944ff 2d9137ce 4721e077 471e3a13 ebb35882 1a53f496 c7a52400 ' into temp-merge-1809
This commit is contained in:
@@ -289,7 +289,6 @@ int secp256k1_ec_pubkey_parse(const secp256k1_context* ctx, secp256k1_pubkey* pu
|
||||
int secp256k1_ec_pubkey_serialize(const secp256k1_context* ctx, unsigned char *output, size_t *outputlen, const secp256k1_pubkey* pubkey, unsigned int flags) {
|
||||
secp256k1_ge Q;
|
||||
size_t len;
|
||||
int ret = 0;
|
||||
|
||||
VERIFY_CHECK(ctx != NULL);
|
||||
ARG_CHECK(outputlen != NULL);
|
||||
@@ -301,12 +300,16 @@ 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;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int secp256k1_ec_pubkey_cmp(const secp256k1_context* ctx, const secp256k1_pubkey* pubkey0, const secp256k1_pubkey* pubkey1) {
|
||||
@@ -342,8 +345,13 @@ static int secp256k1_ec_pubkey_sort_cmp(const void* pk1, const void* pk2, void *
|
||||
}
|
||||
|
||||
int secp256k1_ec_pubkey_sort(const secp256k1_context* ctx, const secp256k1_pubkey **pubkeys, size_t n_pubkeys) {
|
||||
size_t i;
|
||||
|
||||
VERIFY_CHECK(ctx != NULL);
|
||||
ARG_CHECK(pubkeys != NULL);
|
||||
for (i = 0; i < n_pubkeys; i++) {
|
||||
ARG_CHECK(pubkeys[i] != NULL);
|
||||
}
|
||||
|
||||
/* Suppress wrong warning (fixed in MSVC 19.33) */
|
||||
#if defined(_MSC_VER) && (_MSC_VER < 1933)
|
||||
|
||||
Reference in New Issue
Block a user