Skip to content

Commit

Permalink
Add a comment about why we hash the message and the set of nonce comm… (
Browse files Browse the repository at this point in the history
#407)

Add a comment about why we hash the message and the set of nonce commitments as part of creating the preimage for the binding factor
  • Loading branch information
dconnolly authored Jun 22, 2023
1 parent 8defd2c commit 8b09d9d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions frost-core/src/frost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,9 @@ where
) -> Vec<(Identifier<C>, Vec<u8>)> {
let mut binding_factor_input_prefix = vec![];

// The message is hashed with H4 to force the variable-length message
// into a fixed-length byte string, same for hashing the variable-sized
// (between runs of the protocol) set of group commitments, but with H5.
binding_factor_input_prefix.extend_from_slice(C::H4(self.message.as_slice()).as_ref());
binding_factor_input_prefix.extend_from_slice(
C::H5(&round1::encode_group_commitments(self.signing_commitments())[..]).as_ref(),
Expand Down

0 comments on commit 8b09d9d

Please sign in to comment.