mirror of
https://github.com/mimblewimble/grin.git
synced 2025-01-21 03:21:08 +03:00
allow specific nonce in aggsig sign single call (#2696)
This commit is contained in:
parent
a2adf2dfe8
commit
bd6824ca4c
2 changed files with 4 additions and 3 deletions
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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()),
|
||||
|
|
Loading…
Reference in a new issue