Turn secp256k1_ec_pubkey_serialize outlen to in/out

This commit is contained in:
Pieter Wuille
2015-11-05 06:01:56 +01:00
parent 970164dace
commit 06aeea555e
4 changed files with 15 additions and 10 deletions

View File

@@ -173,6 +173,7 @@ int secp256k1_ec_pubkey_serialize(const secp256k1_context* ctx, unsigned char *o
(void)ctx;
VERIFY_CHECK(ctx != NULL);
ARG_CHECK(outputlen != NULL);
ARG_CHECK(*outputlen >= ((flags & SECP256K1_FLAGS_BIT_COMPRESSION) ? 33 : 65));
len = *outputlen;
*outputlen = 0;
ARG_CHECK(output != NULL);