@@ -96,6 +96,7 @@ pub fn calculate_partial_sig(
96
96
secp : & Secp256k1 ,
97
97
sec_key : & SecretKey ,
98
98
sec_nonce : & SecretKey ,
99
+ sec_nonce_extra : Option < & SecretKey > ,
99
100
nonce_sum : & PublicKey ,
100
101
pubkey_sum : Option < & PublicKey > ,
101
102
msg : & secp:: Message ,
@@ -106,7 +107,7 @@ pub fn calculate_partial_sig(
106
107
& msg,
107
108
sec_key,
108
109
Some ( sec_nonce) ,
109
- None ,
110
+ sec_nonce_extra ,
110
111
Some ( nonce_sum) ,
111
112
pubkey_sum,
112
113
Some ( nonce_sum) ,
@@ -179,6 +180,7 @@ pub fn verify_partial_sig(
179
180
secp : & Secp256k1 ,
180
181
sig : & Signature ,
181
182
pub_nonce_sum : & PublicKey ,
183
+ pub_nonce_extra : Option < & PublicKey > ,
182
184
pubkey : & PublicKey ,
183
185
pubkey_sum : Option < & PublicKey > ,
184
186
msg : & secp:: Message ,
@@ -188,6 +190,7 @@ pub fn verify_partial_sig(
188
190
sig,
189
191
& msg,
190
192
Some ( & pub_nonce_sum) ,
193
+ pub_nonce_extra,
191
194
pubkey,
192
195
pubkey_sum,
193
196
true ,
@@ -323,7 +326,7 @@ pub fn verify_single_from_commit(
323
326
commit : & Commitment ,
324
327
) -> Result < ( ) , Error > {
325
328
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 ) {
327
330
return Err ( ErrorKind :: Signature ( "Signature validation error" . to_string ( ) ) . into ( ) ) ;
328
331
}
329
332
Ok ( ( ) )
@@ -391,7 +394,7 @@ pub fn verify_completed_sig(
391
394
pubkey_sum : Option < & PublicKey > ,
392
395
msg : & secp:: Message ,
393
396
) -> 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 ) {
395
398
return Err ( ErrorKind :: Signature ( "Signature validation error" . to_string ( ) ) . into ( ) ) ;
396
399
}
397
400
Ok ( ( ) )
@@ -414,9 +417,19 @@ pub fn sign_single(
414
417
msg : & Message ,
415
418
skey : & SecretKey ,
416
419
snonce : Option < & SecretKey > ,
420
+ snonce_extra : Option < & SecretKey > ,
417
421
pubkey_sum : Option < & PublicKey > ,
418
422
) -> 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
+ ) ?;
420
433
Ok ( sig)
421
434
}
422
435
@@ -426,12 +439,20 @@ pub fn verify_single(
426
439
sig : & Signature ,
427
440
msg : & Message ,
428
441
pubnonce : Option < & PublicKey > ,
442
+ pubnonce_extra : Option < & PublicKey > ,
429
443
pubkey : & PublicKey ,
430
444
pubkey_sum : Option < & PublicKey > ,
431
445
is_partial : bool ,
432
446
) -> bool {
433
447
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,
435
456
)
436
457
}
437
458
0 commit comments