Skip to content

Commit 081e5fc

Browse files
committed
frost trusted dealer: add tests
Add api tests, nonce tests, tweak tests, sha256 tag tests, and constant time tests.
1 parent bef6f7c commit 081e5fc

File tree

6 files changed

+1027
-16
lines changed

6 files changed

+1027
-16
lines changed

.github/workflows/ci.yml

+22-11
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ env:
4141
ECDSAADAPTOR: 'no'
4242
BPPP: 'no'
4343
SCHNORRSIG_HALFAGG: 'no'
44+
FROST: 'no'
4445
### test options
4546
SECP256K1_TEST_ITERS:
4647
BENCH: 'yes'
@@ -79,14 +80,14 @@ jobs:
7980
matrix:
8081
configuration:
8182
- env_vars: { WIDEMUL: 'int64', RECOVERY: 'yes' }
82-
- env_vars: { WIDEMUL: 'int64', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes'}
83+
- env_vars: { WIDEMUL: 'int64', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes', FROST: 'yes' }
8384
- env_vars: { WIDEMUL: 'int128' }
8485
- env_vars: { WIDEMUL: 'int128_struct', ELLSWIFT: 'yes' }
8586
- env_vars: { WIDEMUL: 'int128', RECOVERY: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes' }
86-
- env_vars: { WIDEMUL: 'int128', ECDH: 'yes', SCHNORRSIG: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes'}
87+
- env_vars: { WIDEMUL: 'int128', ECDH: 'yes', SCHNORRSIG: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes', FROST: 'yes' }
8788
- env_vars: { WIDEMUL: 'int128', ASM: 'x86_64', ELLSWIFT: 'yes' }
88-
- env_vars: { RECOVERY: 'yes', SCHNORRSIG: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes'}
89-
- env_vars: { CTIMETESTS: 'no', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes', CPPFLAGS: '-DVERIFY' }
89+
- env_vars: { RECOVERY: 'yes', SCHNORRSIG: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes', FROST: 'yes' }
90+
- env_vars: { CTIMETESTS: 'no', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes', FROST: 'yes', CPPFLAGS: '-DVERIFY' }
9091
- env_vars: { BUILD: 'distcheck', WITH_VALGRIND: 'no', CTIMETESTS: 'no', BENCH: 'no' }
9192
- env_vars: { CPPFLAGS: '-DDETERMINISTIC' }
9293
- env_vars: { CFLAGS: '-O0', CTIMETESTS: 'no' }
@@ -158,6 +159,7 @@ jobs:
158159
ECDSAADAPTOR: 'yes'
159160
BPPP: 'yes'
160161
SCHNORRSIG_HALFAGG: 'yes'
162+
FROST: 'yes'
161163
CC: ${{ matrix.cc }}
162164

163165
steps:
@@ -211,6 +213,7 @@ jobs:
211213
ECDSAADAPTOR: 'yes'
212214
BPPP: 'yes'
213215
SCHNORRSIG_HALFAGG: 'yes'
216+
FROST: 'yes'
214217
CTIMETESTS: 'no'
215218

216219
steps:
@@ -271,6 +274,7 @@ jobs:
271274
ECDSAADAPTOR: 'yes'
272275
BPPP: 'yes'
273276
SCHNORRSIG_HALFAGG: 'yes'
277+
FROST: 'yes'
274278
CTIMETESTS: 'no'
275279

276280
steps:
@@ -325,6 +329,7 @@ jobs:
325329
ECDSAADAPTOR: 'yes'
326330
BPPP: 'yes'
327331
SCHNORRSIG_HALFAGG: 'yes'
332+
FROST: 'yes'
328333
CTIMETESTS: 'no'
329334

330335
strategy:
@@ -389,6 +394,7 @@ jobs:
389394
ECDSAADAPTOR: 'yes'
390395
BPPP: 'yes'
391396
SCHNORRSIG_HALFAGG: 'yes'
397+
FROST: 'yes'
392398
CTIMETESTS: 'no'
393399

394400
steps:
@@ -450,6 +456,7 @@ jobs:
450456
ECDSAADAPTOR: 'yes'
451457
BPPP: 'yes'
452458
SCHNORRSIG_HALFAGG: 'yes'
459+
FROST: 'yes'
453460
CTIMETESTS: 'no'
454461
SECP256K1_TEST_ITERS: 2
455462

@@ -510,6 +517,7 @@ jobs:
510517
ECDSAADAPTOR: 'yes'
511518
BPPP: 'yes'
512519
SCHNORRSIG_HALFAGG: 'yes'
520+
FROST: 'yes'
513521
CTIMETESTS: 'no'
514522
CFLAGS: '-fsanitize=undefined,address -g'
515523
UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1'
@@ -576,6 +584,7 @@ jobs:
576584
ECDSAADAPTOR: 'yes'
577585
BPPP: 'yes'
578586
SCHNORRSIG_HALFAGG: 'yes'
587+
FROST: 'yes'
579588
CTIMETESTS: 'yes'
580589
CC: 'clang'
581590
SECP256K1_TEST_ITERS: 32
@@ -632,6 +641,7 @@ jobs:
632641
ECDSAADAPTOR: 'yes'
633642
BPPP: 'yes'
634643
SCHNORRSIG_HALFAGG: 'yes'
644+
FROST: 'yes'
635645
CTIMETESTS: 'no'
636646

637647
strategy:
@@ -688,15 +698,15 @@ jobs:
688698
fail-fast: false
689699
matrix:
690700
env_vars:
691-
- { WIDEMUL: 'int64', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes' }
701+
- { WIDEMUL: 'int64', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes', FROST: 'yes' }
692702
- { WIDEMUL: 'int128_struct', ECMULTGENPRECISION: 2, ECMULTWINDOW: 4 }
693-
- { WIDEMUL: 'int128', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes' }
703+
- { WIDEMUL: 'int128', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes', FROST: 'yes' }
694704
- { WIDEMUL: 'int128', RECOVERY: 'yes' }
695-
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes' }
696-
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes', CC: 'gcc' }
697-
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes', WRAPPER_CMD: 'valgrind --error-exitcode=42', SECP256K1_TEST_ITERS: 2 }
698-
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes', CC: 'gcc', WRAPPER_CMD: 'valgrind --error-exitcode=42', SECP256K1_TEST_ITERS: 2 }
699-
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes', CPPFLAGS: '-DVERIFY', CTIMETESTS: 'no' }
705+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes', FROST: 'yes' }
706+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes', CC: 'gcc', FROST: 'yes' }
707+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes', FROST: 'yes', WRAPPER_CMD: 'valgrind --error-exitcode=42', SECP256K1_TEST_ITERS: 2 }
708+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes', FROST: 'yes', CC: 'gcc', WRAPPER_CMD: 'valgrind --error-exitcode=42', SECP256K1_TEST_ITERS: 2 }
709+
- { WIDEMUL: 'int128', RECOVERY: 'yes', ECDH: 'yes', SCHNORRSIG: 'yes', ELLSWIFT: 'yes', EXPERIMENTAL: 'yes', ECDSA_S2C: 'yes', RANGEPROOF: 'yes', WHITELIST: 'yes', GENERATOR: 'yes', MUSIG: 'yes', ECDSAADAPTOR: 'yes', BPPP: 'yes', SCHNORRSIG_HALFAGG: 'yes', FROST: 'yes', CPPFLAGS: '-DVERIFY', CTIMETESTS: 'no' }
700710
- BUILD: 'distcheck'
701711

702712
steps:
@@ -816,6 +826,7 @@ jobs:
816826
ECDSAADAPTOR: 'yes'
817827
BPPP: 'yes'
818828
SCHNORRSIG_HALFAGG: 'yes'
829+
FROST: 'yes'
819830

820831
steps:
821832
- name: Checkout

ci/ci.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ print_environment() {
1515
ECMULTWINDOW ECMULTGENPRECISION ASM WIDEMUL WITH_VALGRIND EXTRAFLAGS \
1616
EXPERIMENTAL ECDH RECOVERY SCHNORRSIG SCHNORRSIG_HALFAGG ELLSWIFT \
1717
ECDSA_S2C GENERATOR RANGEPROOF WHITELIST MUSIG ECDSAADAPTOR BPPP \
18-
SECP256K1_TEST_ITERS BENCH SECP256K1_BENCH_ITERS CTIMETESTS\
18+
FROST SECP256K1_TEST_ITERS BENCH SECP256K1_BENCH_ITERS CTIMETESTS\
1919
EXAMPLES \
2020
HOST WRAPPER_CMD \
2121
CC CFLAGS CPPFLAGS AR NM
@@ -83,6 +83,7 @@ esac
8383
--enable-module-schnorrsig="$SCHNORRSIG" --enable-module-musig="$MUSIG" --enable-module-ecdsa-adaptor="$ECDSAADAPTOR" \
8484
--enable-module-schnorrsig="$SCHNORRSIG" \
8585
--enable-module-schnorrsig-halfagg="$SCHNORRSIG_HALFAGG" \
86+
--enable-module-frost="$FROST" \
8687
--enable-examples="$EXAMPLES" \
8788
--enable-ctime-tests="$CTIMETESTS" \
8889
--with-valgrind="$WITH_VALGRIND" \

src/ctime_tests.c

+103
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
#include "../include/secp256k1_musig.h"
4848
#endif
4949

50+
#ifdef ENABLE_MODULE_FROST
51+
#include "include/secp256k1_frost.h"
52+
#endif
53+
5054
static void run_tests(secp256k1_context *ctx, unsigned char *key);
5155

5256
int main(void) {
@@ -349,4 +353,103 @@ static void run_tests(secp256k1_context *ctx, unsigned char *key) {
349353
CHECK(ret == 1);
350354
}
351355
#endif
356+
357+
#ifdef ENABLE_MODULE_FROST
358+
{
359+
secp256k1_pubkey pk[2];
360+
unsigned char session_id[32];
361+
unsigned char seed[32];
362+
secp256k1_frost_secnonce secnonce[2];
363+
secp256k1_frost_pubnonce pubnonce[2];
364+
const secp256k1_frost_pubnonce *pubnonce_ptr[2];
365+
secp256k1_frost_keygen_cache cache;
366+
secp256k1_frost_session session;
367+
secp256k1_frost_partial_sig partial_sig;
368+
const secp256k1_frost_partial_sig *partial_sig_ptr[1];
369+
unsigned char extra_input[32];
370+
unsigned char sec_adaptor[32];
371+
secp256k1_pubkey adaptor;
372+
unsigned char pre_sig[64];
373+
int nonce_parity;
374+
secp256k1_frost_share shares[2];
375+
secp256k1_pubkey vss_commitment[2];
376+
unsigned char key2[32];
377+
secp256k1_keypair keypair2;
378+
unsigned char id[2][33];
379+
const unsigned char *id_ptr[2];
380+
size_t size = 33;
381+
secp256k1_pubkey pubshare[2];
382+
const secp256k1_pubkey *pubshares_ptr[2];
383+
384+
id_ptr[0] = id[0];
385+
id_ptr[1] = id[1];
386+
pubnonce_ptr[0] = &pubnonce[0];
387+
pubnonce_ptr[1] = &pubnonce[1];
388+
SECP256K1_CHECKMEM_DEFINE(key, 32);
389+
memcpy(seed, key, 32);
390+
seed[0] = seed[0] + 1;
391+
memcpy(extra_input, key, sizeof(extra_input));
392+
extra_input[0] = extra_input[0] + 2;
393+
memcpy(sec_adaptor, key, sizeof(sec_adaptor));
394+
sec_adaptor[0] = extra_input[0] + 3;
395+
memcpy(key2, key, sizeof(key2));
396+
key2[0] = key2[0] + 4;
397+
memcpy(session_id, key, sizeof(session_id));
398+
session_id[0] = session_id[0] + 5;
399+
partial_sig_ptr[0] = &partial_sig;
400+
pubshares_ptr[0] = &pubshare[0];
401+
pubshares_ptr[1] = &pubshare[1];
402+
403+
CHECK(secp256k1_keypair_create(ctx, &keypair, key));
404+
CHECK(secp256k1_keypair_create(ctx, &keypair2, key2));
405+
CHECK(secp256k1_keypair_pub(ctx, &pk[0], &keypair));
406+
CHECK(secp256k1_keypair_pub(ctx, &pk[1], &keypair2));
407+
CHECK(secp256k1_ec_pubkey_serialize(ctx, id[0], &size, &pk[0], SECP256K1_EC_COMPRESSED));
408+
CHECK(secp256k1_ec_pubkey_serialize(ctx, id[1], &size, &pk[1], SECP256K1_EC_COMPRESSED));
409+
410+
/* shares_gen */
411+
SECP256K1_CHECKMEM_UNDEFINE(seed, 32);
412+
ret = secp256k1_frost_shares_gen(ctx, shares, vss_commitment, seed, 2, 2, id_ptr);
413+
SECP256K1_CHECKMEM_DEFINE(&ret, sizeof(ret));
414+
CHECK(ret == 1);
415+
SECP256K1_CHECKMEM_UNDEFINE(&shares[0], sizeof(shares[0]));
416+
SECP256K1_CHECKMEM_UNDEFINE(&shares[1], sizeof(shares[1]));
417+
/* pubkey_gen */
418+
SECP256K1_CHECKMEM_DEFINE(&vss_commitment[0], sizeof(secp256k1_pubkey));
419+
SECP256K1_CHECKMEM_DEFINE(&vss_commitment[1], sizeof(secp256k1_pubkey));
420+
CHECK(secp256k1_frost_compute_pubshare(ctx, &pubshare[0], 2, id_ptr[0], vss_commitment));
421+
CHECK(secp256k1_frost_compute_pubshare(ctx, &pubshare[1], 2, id_ptr[1], vss_commitment));
422+
CHECK(secp256k1_frost_pubkey_gen(ctx, &cache, pubshares_ptr, 2, id_ptr));
423+
/* nonce_gen */
424+
SECP256K1_CHECKMEM_UNDEFINE(session_id, sizeof(session_id));
425+
CHECK(secp256k1_ec_pubkey_create(ctx, &adaptor, sec_adaptor));
426+
SECP256K1_CHECKMEM_UNDEFINE(extra_input, sizeof(extra_input));
427+
SECP256K1_CHECKMEM_UNDEFINE(sec_adaptor, sizeof(sec_adaptor));
428+
ret = secp256k1_frost_nonce_gen(ctx, &secnonce[0], &pubnonce[0], session_id, &shares[0], msg, &cache, extra_input);
429+
SECP256K1_CHECKMEM_DEFINE(&ret, sizeof(ret));
430+
CHECK(ret == 1);
431+
ret = secp256k1_frost_nonce_gen(ctx, &secnonce[1], &pubnonce[1], session_id, &shares[1], msg, &cache, extra_input);
432+
SECP256K1_CHECKMEM_DEFINE(&ret, sizeof(ret));
433+
CHECK(ret == 1);
434+
/* partial_sign */
435+
/* Make sure that previous tests don't undefine msg. It's not used as a secret here. */
436+
SECP256K1_CHECKMEM_DEFINE(msg, sizeof(msg));
437+
CHECK(secp256k1_frost_nonce_process(ctx, &session, pubnonce_ptr, 2, msg, id_ptr[0], id_ptr, &cache, &adaptor) == 1);
438+
ret = secp256k1_frost_partial_sign(ctx, &partial_sig, &secnonce[0], &shares[0], &session, &cache);
439+
SECP256K1_CHECKMEM_DEFINE(&ret, sizeof(ret));
440+
CHECK(ret == 1);
441+
/* adapt */
442+
SECP256K1_CHECKMEM_DEFINE(&partial_sig, sizeof(partial_sig));
443+
CHECK(secp256k1_frost_partial_sig_agg(ctx, pre_sig, &session, partial_sig_ptr, 1));
444+
SECP256K1_CHECKMEM_DEFINE(pre_sig, sizeof(pre_sig));
445+
CHECK(secp256k1_frost_nonce_parity(ctx, &nonce_parity, &session));
446+
ret = secp256k1_frost_adapt(ctx, sig, pre_sig, sec_adaptor, nonce_parity);
447+
SECP256K1_CHECKMEM_DEFINE(&ret, sizeof(ret));
448+
CHECK(ret == 1);
449+
/* extract_adaptor */
450+
ret = secp256k1_frost_extract_adaptor(ctx, sec_adaptor, sig, pre_sig, nonce_parity);
451+
SECP256K1_CHECKMEM_DEFINE(&ret, sizeof(ret));
452+
CHECK(ret == 1);
453+
}
454+
#endif
352455
}

src/modules/frost/Makefile.am.include

+1
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ noinst_HEADERS += src/modules/frost/keygen_impl.h
55
noinst_HEADERS += src/modules/frost/session.h
66
noinst_HEADERS += src/modules/frost/session_impl.h
77
noinst_HEADERS += src/modules/frost/adaptor_impl.h
8+
noinst_HEADERS += src/modules/frost/tests_impl.h

0 commit comments

Comments
 (0)