@@ -32,6 +32,8 @@ void run_frost_tests(void) {
32
32
secp256k1_keypair keypair ;
33
33
secp256k1_frost_secnonce k ;
34
34
secp256k1_frost_keygen_session sessions [N_SIGNERS ];
35
+ secp256k1_xonly_pubkey combined_nonce ;
36
+ int combined_nonce_parity ;
35
37
int i , j ;
36
38
37
39
/* Round 1.1, 1.2, 1.3, and 1.4 */
@@ -104,9 +106,8 @@ void run_frost_tests(void) {
104
106
secp256k1_ge_set_gej (& rp , & rj );
105
107
secp256k1_pubkey_save (& pubkeys [i ], & rp );
106
108
}
107
- sessions [0 ].n_signers = THRESHOLD ;
108
- CHECK (secp256k1_frost_pubkey_combine (ctx , NULL , & sessions [0 ], pubkeys ));
109
- CHECK (secp256k1_xonly_pubkey_serialize (ctx , pk2 , & sessions [0 ].combined_pk ));
109
+ CHECK (secp256k1_frost_nonce_combine (ctx , pubkeys , THRESHOLD , & combined_nonce_parity , & combined_nonce ));
110
+ CHECK (secp256k1_xonly_pubkey_serialize (ctx , pk2 , & combined_nonce ));
110
111
/* sign */
111
112
for (i = 0 ; i < THRESHOLD ; i ++ ) {
112
113
/* compute challenge hash */
@@ -116,10 +117,10 @@ void run_frost_tests(void) {
116
117
secp256k1_frost_lagrange_coefficient (& l , participants , THRESHOLD , sessions [i ].my_index );
117
118
secp256k1_scalar_mul (& s1 , & s1 , & l );
118
119
secp256k1_scalar_mul (& s2 , & s2 , & s1 );
119
- CHECK (secp256k1_xonly_pubkey_serialize (ctx , pk2 , & sessions [ 0 ]. combined_pk ));
120
+ CHECK (secp256k1_xonly_pubkey_serialize (ctx , pk2 , & combined_nonce ));
120
121
secp256k1_nonce_function_frost (& k , id , sessions [i ].agg_share .data , msg , & pk1 [1 ], frost_algo , 9 , NULL );
121
122
secp256k1_scalar_set_b32 (& s1 , k .data , NULL );
122
- if (sessions [ 0 ]. pk_parity ) {
123
+ if (combined_nonce_parity ) {
123
124
secp256k1_scalar_negate (& s1 , & s1 );
124
125
125
126
}
0 commit comments