Skip to content

Commit a732222

Browse files
committed
Add x-only ECDH ctime tests
1 parent 0e8602c commit a732222

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/ctime_tests.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,12 @@ static void run_tests(secp256k1_context *ctx, unsigned char *key) {
115115
ret = secp256k1_ecdh(ctx, msg, &pubkey, key, NULL, NULL);
116116
SECP256K1_CHECKMEM_DEFINE(&ret, sizeof(ret));
117117
CHECK(ret == 1);
118+
119+
/* Test X-only ECDH. */
120+
SECP256K1_CHECKMEM_UNDEFINE(key, 32);
121+
ret = secp256k1_ecdh_xonly(ctx, msg, spubkey + 1, key, NULL, NULL);
122+
SECP256K1_CHECKMEM_DEFINE(&ret, sizeof(ret));
123+
CHECK(ret == 1);
118124
#endif
119125

120126
#ifdef ENABLE_MODULE_RECOVERY

0 commit comments

Comments
 (0)