Skip to content

Commit 372c455

Browse files
committed
Add schnorrsig_sign to the valgrind ctime test
1 parent bf2df44 commit 372c455

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/valgrind_ctime_test.c

+15
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@
1212
# include "include/secp256k1_ecdh.h"
1313
#endif
1414

15+
16+
#if ENABLE_MODULE_SCHNORRSIG
17+
#include "include/secp256k1_schnorrsig.h"
18+
#endif
19+
1520
int main(void) {
1621
secp256k1_context* ctx;
1722
secp256k1_ecdsa_signature signature;
@@ -24,6 +29,9 @@ int main(void) {
2429
unsigned char key[32];
2530
unsigned char sig[74];
2631
unsigned char spubkey[33];
32+
#if ENABLE_MODULE_SCHNORRSIG
33+
secp256k1_schnorrsig schnorrsig;
34+
#endif
2735

2836
if (!RUNNING_ON_VALGRIND) {
2937
fprintf(stderr, "This test can only usefully be run inside valgrind.\n");
@@ -67,6 +75,13 @@ int main(void) {
6775
CHECK(ret == 1);
6876
#endif
6977

78+
#if ENABLE_MODULE_SCHNORRSIG
79+
VALGRIND_MAKE_MEM_UNDEFINED(key, 32);
80+
ret = secp256k1_schnorrsig_sign(ctx, &schnorrsig, msg, key, NULL, NULL);
81+
VALGRIND_MAKE_MEM_DEFINED(&ret, sizeof(ret));
82+
CHECK(ret == 1);
83+
#endif
84+
7085
VALGRIND_MAKE_MEM_UNDEFINED(key, 32);
7186
ret = secp256k1_ec_seckey_verify(ctx, key);
7287
VALGRIND_MAKE_MEM_DEFINED(&ret, sizeof(ret));

0 commit comments

Comments
 (0)