@@ -96,6 +96,7 @@ pub fn calculate_partial_sig(
9696 secp : & Secp256k1 ,
9797 sec_key : & SecretKey ,
9898 sec_nonce : & SecretKey ,
99+ sec_nonce_extra : Option < & SecretKey > ,
99100 nonce_sum : & PublicKey ,
100101 pubkey_sum : Option < & PublicKey > ,
101102 msg : & secp:: Message ,
@@ -106,7 +107,7 @@ pub fn calculate_partial_sig(
106107 & msg,
107108 sec_key,
108109 Some ( sec_nonce) ,
109- None ,
110+ sec_nonce_extra ,
110111 Some ( nonce_sum) ,
111112 pubkey_sum,
112113 Some ( nonce_sum) ,
@@ -179,6 +180,7 @@ pub fn verify_partial_sig(
179180 secp : & Secp256k1 ,
180181 sig : & Signature ,
181182 pub_nonce_sum : & PublicKey ,
183+ pub_nonce_extra : Option < & PublicKey > ,
182184 pubkey : & PublicKey ,
183185 pubkey_sum : Option < & PublicKey > ,
184186 msg : & secp:: Message ,
@@ -188,6 +190,7 @@ pub fn verify_partial_sig(
188190 sig,
189191 & msg,
190192 Some ( & pub_nonce_sum) ,
193+ pub_nonce_extra,
191194 pubkey,
192195 pubkey_sum,
193196 true ,
@@ -323,7 +326,7 @@ pub fn verify_single_from_commit(
323326 commit : & Commitment ,
324327) -> Result < ( ) , Error > {
325328 let pubkey = commit. to_pubkey ( secp) ?;
326- if !verify_single ( secp, sig, msg, None , & pubkey, Some ( & pubkey) , false ) {
329+ if !verify_single ( secp, sig, msg, None , None , & pubkey, Some ( & pubkey) , false ) {
327330 return Err ( ErrorKind :: Signature ( "Signature validation error" . to_string ( ) ) . into ( ) ) ;
328331 }
329332 Ok ( ( ) )
@@ -391,7 +394,7 @@ pub fn verify_completed_sig(
391394 pubkey_sum : Option < & PublicKey > ,
392395 msg : & secp:: Message ,
393396) -> Result < ( ) , Error > {
394- if !verify_single ( secp, sig, msg, None , pubkey, pubkey_sum, true ) {
397+ if !verify_single ( secp, sig, msg, None , None , pubkey, pubkey_sum, true ) {
395398 return Err ( ErrorKind :: Signature ( "Signature validation error" . to_string ( ) ) . into ( ) ) ;
396399 }
397400 Ok ( ( ) )
@@ -414,9 +417,19 @@ pub fn sign_single(
414417 msg : & Message ,
415418 skey : & SecretKey ,
416419 snonce : Option < & SecretKey > ,
420+ snonce_extra : Option < & SecretKey > ,
417421 pubkey_sum : Option < & PublicKey > ,
418422) -> Result < Signature , Error > {
419- let sig = aggsig:: sign_single ( secp, & msg, skey, snonce, None , None , pubkey_sum, None ) ?;
423+ let sig = aggsig:: sign_single (
424+ secp,
425+ & msg,
426+ skey,
427+ snonce,
428+ snonce_extra,
429+ None ,
430+ pubkey_sum,
431+ None ,
432+ ) ?;
420433 Ok ( sig)
421434}
422435
@@ -426,12 +439,20 @@ pub fn verify_single(
426439 sig : & Signature ,
427440 msg : & Message ,
428441 pubnonce : Option < & PublicKey > ,
442+ pubnonce_extra : Option < & PublicKey > ,
429443 pubkey : & PublicKey ,
430444 pubkey_sum : Option < & PublicKey > ,
431445 is_partial : bool ,
432446) -> bool {
433447 aggsig:: verify_single (
434- secp, sig, msg, pubnonce, pubkey, pubkey_sum, None , is_partial,
448+ secp,
449+ sig,
450+ msg,
451+ pubnonce,
452+ pubkey,
453+ pubkey_sum,
454+ pubnonce_extra,
455+ is_partial,
435456 )
436457}
437458
0 commit comments