stick to e=H(R|P|m) when use schnorr signature

This commit is contained in:
Gary Yu 2018-12-21 22:38:16 +08:00
parent bc7780354c
commit aa8d0cfb7c

View file

@ -260,7 +260,7 @@ impl Slate {
if let Some(m) = message.clone() { if let Some(m) = message.clone() {
let hashed = blake2b(secp::constants::MESSAGE_SIZE, &[], &m.as_bytes()[..]); let hashed = blake2b(secp::constants::MESSAGE_SIZE, &[], &m.as_bytes()[..]);
let m = secp::Message::from_slice(&hashed.as_bytes())?; let m = secp::Message::from_slice(&hashed.as_bytes())?;
let res = aggsig::sign_single(&keychain.secp(), &m, &sec_key, None)?; let res = aggsig::sign_single(&keychain.secp(), &m, &sec_key, Some(&pub_key))?;
Some(res) Some(res)
} else { } else {
None None
@ -360,7 +360,7 @@ impl Slate {
&m, &m,
None, None,
&p.public_blind_excess, &p.public_blind_excess,
None, Some(&p.public_blind_excess),
false, false,
) { ) {
return Err(ErrorKind::Signature( return Err(ErrorKind::Signature(