contexts: Forbid randomizing secp256k1_context_static

This commit is contained in:
Tim Ruffing
2022-12-07 14:50:14 +01:00
parent 4b6df5e33e
commit 61841fc9ee
4 changed files with 57 additions and 17 deletions

View File

@@ -749,6 +749,8 @@ int secp256k1_ec_pubkey_tweak_mul(const secp256k1_context* ctx, secp256k1_pubkey
int secp256k1_context_randomize(secp256k1_context* ctx, const unsigned char *seed32) {
VERIFY_CHECK(ctx != NULL);
ARG_CHECK(secp256k1_context_is_proper(ctx));
if (secp256k1_ecmult_gen_context_is_built(&ctx->ecmult_gen_ctx)) {
secp256k1_ecmult_gen_blind(&ctx->ecmult_gen_ctx, seed32);
}