Skip to content

Commit

Permalink
allow specific nonce in aggsig sign single call (#2696)
Browse files Browse the repository at this point in the history
  • Loading branch information
yeastplume authored Mar 21, 2019
1 parent a2adf2d commit bd6824c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions core/src/libtx/aggsig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -421,14 +421,15 @@ pub fn add_signatures(
Ok(sig)
}

/// Just a simple sig, creates its own nonce, etc
/// Just a simple sig, creates its own nonce if not provided
pub fn sign_single(
secp: &Secp256k1,
msg: &Message,
skey: &SecretKey,
snonce: Option<&SecretKey>,
pubkey_sum: Option<&PublicKey>,
) -> Result<Signature, Error> {
let sig = aggsig::sign_single(secp, &msg, skey, None, None, None, pubkey_sum, None)?;
let sig = aggsig::sign_single(secp, &msg, skey, snonce, None, None, pubkey_sum, None)?;
Ok(sig)
}

Expand Down
2 changes: 1 addition & 1 deletion core/src/libtx/secp_ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ mod test {
let mut msg = [0u8; 32];
thread_rng().fill(&mut msg);
let msg = Message::from_slice(&msg).unwrap();
let sig = aggsig::sign_single(&secp, &msg, &sk, None).unwrap();
let sig = aggsig::sign_single(&secp, &msg, &sk, None, None).unwrap();
SerTest {
pub_key: PublicKey::from_secret_key(&secp, &sk).unwrap(),
opt_sig: Some(sig.clone()),
Expand Down

0 comments on commit bd6824c

Please sign in to comment.