From 3e08b02e2a78f2a1fc457efab665db8ab8085373 Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Mon, 30 Mar 2020 14:51:38 +0000 Subject: [PATCH] Make the secp256k1_declassify argument constant This is required to declassify pointers to constant memory. Declassify should never modify its argument. --- src/secp256k1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/secp256k1.c b/src/secp256k1.c index b43a959..4a55ad6 100644 --- a/src/secp256k1.c +++ b/src/secp256k1.c @@ -227,7 +227,7 @@ void secp256k1_scratch_space_destroy(const secp256k1_context *ctx, secp256k1_scr * of the software. This is setup for use with valgrind but could be substituted with * the appropriate instrumentation for other analysis tools. */ -static SECP256K1_INLINE void secp256k1_declassify(const secp256k1_context* ctx, void *p, size_t len) { +static SECP256K1_INLINE void secp256k1_declassify(const secp256k1_context* ctx, const void *p, size_t len) { #if defined(VALGRIND) if (EXPECT(ctx->declassify,0)) VALGRIND_MAKE_MEM_DEFINED(p, len); #else