Skip to content

Commit 2f05e69

Browse files
committed
Replace secp256k1_ecmult_context_clear() with SECP256K1_CLEANSE()
1 parent 059012f commit 2f05e69

File tree

3 files changed

+1
-6
lines changed

3 files changed

+1
-6
lines changed

src/ecmult.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ static void secp256k1_ecmult_context_build(secp256k1_ecmult_context *ctx, const
2323
static void secp256k1_ecmult_context_clone(secp256k1_ecmult_context *dst,
2424
const secp256k1_ecmult_context *src, const secp256k1_callback *cb);
2525
static void secp256k1_ecmult_context_teardown(secp256k1_ecmult_context *ctx);
26-
static void secp256k1_ecmult_context_clear(secp256k1_ecmult_context *ctx);
2726
static int secp256k1_ecmult_context_is_built(const secp256k1_ecmult_context *ctx);
2827

2928
/** Double multiply: R = na*A + ng*G */

src/ecmult_impl.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,6 @@ static void secp256k1_ecmult_context_teardown(secp256k1_ecmult_context *ctx) {
224224
#endif
225225
}
226226

227-
static void secp256k1_ecmult_context_clear(secp256k1_ecmult_context *ctx) {
228-
secp256k1_ecmult_context_init(ctx);
229-
}
230-
231227
/** Convert a number to WNAF notation. The number becomes represented by sum(2^i * wnaf[i], i=0..bits),
232228
* with the following guarantees:
233229
* - each wnaf[i] is either 0, or an odd integer between -(1<<(w-1) - 1) and (1<<(w-1) - 1)

src/secp256k1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ secp256k1_context* secp256k1_context_clone(const secp256k1_context* ctx) {
9292
void secp256k1_context_destroy(secp256k1_context* ctx) {
9393
if (ctx != NULL) {
9494
secp256k1_ecmult_context_teardown(&ctx->ecmult_ctx);
95-
secp256k1_ecmult_context_clear(&ctx->ecmult_ctx);
95+
SECP256K1_CLEANSE(ctx->ecmult_ctx);
9696
secp256k1_ecmult_gen_context_clear(&ctx->ecmult_gen_ctx);
9797

9898
free(ctx);

0 commit comments

Comments
 (0)