Skip to content

Commit

Permalink
Make the secp256k1_declassify argument constant
Browse files Browse the repository at this point in the history
This is required to declassify pointers to constant memory. Declassify should
never modify its argument.
  • Loading branch information
jonasnick committed Aug 26, 2020
1 parent 670cdd3 commit 3e08b02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/secp256k1.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3e08b02

Please sign in to comment.