Skip to content

Commit

Permalink
Allow majority nonce response messages to generate a valid signature
Browse files Browse the repository at this point in the history
Signed-off-by: Jacinta Ferrant <[email protected]>
  • Loading branch information
jferrant committed Jan 16, 2024
1 parent fac513b commit 4472932
Show file tree
Hide file tree
Showing 4 changed files with 245 additions and 59 deletions.
5 changes: 5 additions & 0 deletions src/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ pub struct NonceResponse {
pub key_ids: Vec<u32>,
/// Public nonces
pub nonces: Vec<PublicNonce>,
/// Bytes being signed
pub message: Vec<u8>,
}

impl Signable for NonceResponse {
Expand All @@ -243,6 +245,8 @@ impl Signable for NonceResponse {
hasher.update(nonce.D.compress().as_bytes());
hasher.update(nonce.E.compress().as_bytes());
}

hasher.update(self.message.as_slice());
}
}

Expand Down Expand Up @@ -677,6 +681,7 @@ mod test {
signer_id: 0,
key_ids: vec![],
nonces: vec![],
message: vec![],
};
let msg = Message::NonceResponse(nonce_response.clone());
let coordinator_packet_nonce_response = Packet {
Expand Down
Loading

0 comments on commit 4472932

Please sign in to comment.