mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-12 04:42:36 -03:00
Merge pull request #239
93226a5
secp256k1.c: Add missing DEBUG_CHECKs for sufficiently capable contexts (Andrew Poelstra)
This commit is contained in:
commit
14aacdc5e5
1 changed files with 5 additions and 0 deletions
|
@ -59,6 +59,8 @@ int secp256k1_ecdsa_verify(const secp256k1_context_t* ctx, const unsigned char *
|
||||||
secp256k1_ecdsa_sig_t s;
|
secp256k1_ecdsa_sig_t s;
|
||||||
secp256k1_scalar_t m;
|
secp256k1_scalar_t m;
|
||||||
int ret = -3;
|
int ret = -3;
|
||||||
|
DEBUG_CHECK(ctx != NULL);
|
||||||
|
DEBUG_CHECK(secp256k1_ecmult_context_is_built(&ctx->ecmult_ctx));
|
||||||
DEBUG_CHECK(msg32 != NULL);
|
DEBUG_CHECK(msg32 != NULL);
|
||||||
DEBUG_CHECK(sig != NULL);
|
DEBUG_CHECK(sig != NULL);
|
||||||
DEBUG_CHECK(pubkey != NULL);
|
DEBUG_CHECK(pubkey != NULL);
|
||||||
|
@ -250,6 +252,8 @@ int secp256k1_ec_pubkey_create(const secp256k1_context_t* ctx, unsigned char *pu
|
||||||
secp256k1_scalar_t sec;
|
secp256k1_scalar_t sec;
|
||||||
int overflow;
|
int overflow;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
DEBUG_CHECK(ctx != NULL);
|
||||||
|
DEBUG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx));
|
||||||
DEBUG_CHECK(pubkey != NULL);
|
DEBUG_CHECK(pubkey != NULL);
|
||||||
DEBUG_CHECK(pubkeylen != NULL);
|
DEBUG_CHECK(pubkeylen != NULL);
|
||||||
DEBUG_CHECK(seckey != NULL);
|
DEBUG_CHECK(seckey != NULL);
|
||||||
|
@ -383,6 +387,7 @@ int secp256k1_ec_privkey_export(const secp256k1_context_t* ctx, const unsigned c
|
||||||
DEBUG_CHECK(seckey != NULL);
|
DEBUG_CHECK(seckey != NULL);
|
||||||
DEBUG_CHECK(privkey != NULL);
|
DEBUG_CHECK(privkey != NULL);
|
||||||
DEBUG_CHECK(privkeylen != NULL);
|
DEBUG_CHECK(privkeylen != NULL);
|
||||||
|
DEBUG_CHECK(ctx != NULL);
|
||||||
DEBUG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx));
|
DEBUG_CHECK(secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx));
|
||||||
|
|
||||||
secp256k1_scalar_set_b32(&key, seckey, NULL);
|
secp256k1_scalar_set_b32(&key, seckey, NULL);
|
||||||
|
|
Loading…
Reference in a new issue