Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6e6e961

Browse files
jonasnickdeadalnix
authored andcommittedSep 29, 2020
valgrind_ctime_test: Add schnorrsig_sign
Summary: This is a partial backport of secp256k1 [[bitcoin-core/secp256k1#558 | PR558]] : bitcoin-core/secp256k1@f431b3f Depends on D7650 Test Plan: ninja check-secp256k1 Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D7651
1 parent 29f529b commit 6e6e961

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
 

‎src/valgrind_ctime_test.c

+14
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
# include "include/secp256k1_extrakeys.h"
2626
#endif
2727

28+
#if ENABLE_MODULE_SCHNORRSIG
29+
#include "include/secp256k1_schnorrsig.h"
30+
#endif
31+
2832
int main(void) {
2933
secp256k1_context* ctx;
3034
secp256k1_ecdsa_signature signature;
@@ -151,6 +155,16 @@ int main(void) {
151155
CHECK(ret == 1);
152156
#endif
153157

158+
#if ENABLE_MODULE_SCHNORRSIG
159+
VALGRIND_MAKE_MEM_UNDEFINED(key, 32);
160+
ret = secp256k1_keypair_create(ctx, &keypair, key);
161+
VALGRIND_MAKE_MEM_DEFINED(&ret, sizeof(ret));
162+
CHECK(ret == 1);
163+
ret = secp256k1_schnorrsig_sign(ctx, sig, msg, &keypair, NULL, NULL);
164+
VALGRIND_MAKE_MEM_DEFINED(&ret, sizeof(ret));
165+
CHECK(ret == 1);
166+
#endif
167+
154168
secp256k1_context_destroy(ctx);
155169
return 0;
156170
}

0 commit comments

Comments
 (0)
Please sign in to comment.