Fix missing clears on secret values

This commit is contained in:
mllwchrry
2026-07-10 19:06:29 +03:00
parent a2b001cc20
commit a69a662d05
4 changed files with 32 additions and 1 deletions

View File

@@ -218,6 +218,7 @@ static int secp256k1_generator_generate_internal(const secp256k1_context* ctx, s
secp256k1_scalar_set_b32(&blind, blind32, &overflow);
ret = !overflow;
secp256k1_ecmult_gen_gej(&ctx->ecmult_gen_ctx, &accum, &blind);
secp256k1_scalar_clear(&blind);
}
secp256k1_sha256_initialize(&sha256);
@@ -356,6 +357,8 @@ int secp256k1_pedersen_blind_sum(const secp256k1_context* ctx, unsigned char *bl
for (i = 0; i < n; i++) {
secp256k1_scalar_set_b32(&x, blinds[i], &overflow);
if (overflow) {
secp256k1_scalar_clear(&acc);
secp256k1_scalar_clear(&x);
return 0;
}
if (i >= npositive) {