Skip to content

Commit

Permalink
valgrind_ctime_test: Add schnorrsig_sign
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jonasnick authored and deadalnix committed Sep 29, 2020
1 parent 29f529b commit 6e6e961
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/valgrind_ctime_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}

0 comments on commit 6e6e961

Please sign in to comment.