From c0510fc91e5b63b600b410f1c3a92dcfa611c26e Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Mon, 20 Dec 2021 15:19:14 +0100 Subject: [PATCH] build(crypto): make valgrind flag compatible with secp256k1-zkp (#2027) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ondřej Vejpustek --- crypto/Makefile | 4 +++- crypto/tests/test_check.c | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crypto/Makefile b/crypto/Makefile index f63659481..c9d514732 100644 --- a/crypto/Makefile +++ b/crypto/Makefile @@ -51,10 +51,12 @@ ZKP_PATH = ../vendor/secp256k1-zkp CFLAGS += -DSECP256K1_CONTEXT_SIZE=208 VALGRIND ?= 1 +ifeq ($(VALGRIND),1) +CFLAGS += -DVALGRIND +endif CFLAGS += -I. CFLAGS += -I.. -CFLAGS += -DVALGRIND=$(VALGRIND) CFLAGS += -DUSE_ETHEREUM=1 CFLAGS += -DUSE_GRAPHENE=1 CFLAGS += -DUSE_KECCAK=1 diff --git a/crypto/tests/test_check.c b/crypto/tests/test_check.c index 8be73e176..5d27d5861 100644 --- a/crypto/tests/test_check.c +++ b/crypto/tests/test_check.c @@ -32,7 +32,7 @@ #include "check_mem.h" -#if VALGRIND +#ifdef VALGRIND #include #include #endif @@ -77,7 +77,7 @@ #include "zkp_context.h" #include "zkp_ecdsa.h" -#if VALGRIND +#ifdef VALGRIND /* * This is a clever trick to make Valgrind's Memcheck verify code * is constant-time with respect to secret data.