Skip to content

Commit 8feb9fb

Browse files
committed
Replace secp256k1_ecmult_gen_context_clear() with SECP256K1_CLEANSE()
1 parent 0edecfd commit 8feb9fb

File tree

4 files changed

+3
-10
lines changed

4 files changed

+3
-10
lines changed

src/ecmult_gen.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ static void secp256k1_ecmult_gen_context_clone(secp256k1_ecmult_gen_context *dst
3535
#ifndef USE_ECMULT_STATIC_PRECOMPUTATION
3636
static void secp256k1_ecmult_gen_context_teardown(secp256k1_ecmult_gen_context* ctx);
3737
#endif
38-
static void secp256k1_ecmult_gen_context_clear(secp256k1_ecmult_gen_context* ctx);
3938
static int secp256k1_ecmult_gen_context_is_built(const secp256k1_ecmult_gen_context* ctx);
4039

4140
/** Multiply with the generator: R = a*G */

src/ecmult_gen_impl.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,6 @@ static void secp256k1_ecmult_gen_context_teardown(secp256k1_ecmult_gen_context *
118118
}
119119
#endif
120120

121-
static void secp256k1_ecmult_gen_context_clear(secp256k1_ecmult_gen_context *ctx) {
122-
SECP256K1_CLEANSE(ctx->blind);
123-
SECP256K1_CLEANSE(ctx->initial);
124-
ctx->prec = NULL;
125-
}
126-
127121
static void secp256k1_ecmult_gen(const secp256k1_ecmult_gen_context *ctx, secp256k1_gej *r, const secp256k1_scalar *gn) {
128122
secp256k1_ge add;
129123
secp256k1_ge_storage adds;

src/gen_context.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ int main(int argc, char **argv) {
6767
#ifndef USE_ECMULT_STATIC_PRECOMPUTATION
6868
secp256k1_ecmult_gen_context_teardown(&ctx);
6969
#endif
70-
secp256k1_ecmult_gen_context_clear(&ctx);
71-
70+
SECP256K1_CLEANSE(ctx);
71+
7272
fprintf(fp, "#undef SC\n");
7373
fprintf(fp, "#endif\n");
7474
fclose(fp);

src/secp256k1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ void secp256k1_context_destroy(secp256k1_context* ctx) {
9696
#ifndef USE_ECMULT_STATIC_PRECOMPUTATION
9797
secp256k1_ecmult_gen_context_teardown(&ctx->ecmult_gen_ctx);
9898
#endif
99-
secp256k1_ecmult_gen_context_clear(&ctx->ecmult_gen_ctx);
99+
SECP256K1_CLEANSE(ctx->ecmult_gen_ctx);
100100

101101
free(ctx);
102102
}

0 commit comments

Comments
 (0)