From 6e6e961d891fa5438c4ab87f4b37816fa61debc7 Mon Sep 17 00:00:00 2001 From: Jonas Nick Date: Thu, 12 Mar 2020 20:05:07 +0000 Subject: [PATCH] valgrind_ctime_test: Add schnorrsig_sign Summary: This is a partial backport of secp256k1 [[https://github.com/bitcoin-core/secp256k1/pull/558 | PR558]] : https://github.com/bitcoin-core/secp256k1/pull/558/commits/f431b3f28ac95a3645ad5a6dc96b878fa30a1de3 Depends on D7650 Test Plan: ninja check-secp256k1 Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D7651 --- src/valgrind_ctime_test.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/valgrind_ctime_test.c b/src/valgrind_ctime_test.c index 5042701b..dd63f6e5 100644 --- a/src/valgrind_ctime_test.c +++ b/src/valgrind_ctime_test.c @@ -25,6 +25,10 @@ # include "include/secp256k1_extrakeys.h" #endif +#if ENABLE_MODULE_SCHNORRSIG +#include "include/secp256k1_schnorrsig.h" +#endif + int main(void) { secp256k1_context* ctx; secp256k1_ecdsa_signature signature; @@ -151,6 +155,16 @@ int main(void) { CHECK(ret == 1); #endif +#if ENABLE_MODULE_SCHNORRSIG + VALGRIND_MAKE_MEM_UNDEFINED(key, 32); + ret = secp256k1_keypair_create(ctx, &keypair, key); + VALGRIND_MAKE_MEM_DEFINED(&ret, sizeof(ret)); + CHECK(ret == 1); + ret = secp256k1_schnorrsig_sign(ctx, sig, msg, &keypair, NULL, NULL); + VALGRIND_MAKE_MEM_DEFINED(&ret, sizeof(ret)); + CHECK(ret == 1); +#endif + secp256k1_context_destroy(ctx); return 0; }