INNER CODE UNIT · Rust
binding_factor_preimages
ZcashFoundation/frost · frost-core/src/lib.rs:413
pub fn binding_factor_preimages(
&self,
verifying_key: &VerifyingKey<C>,
additional_prefix: &[u8],
) -> Result<Vec<(Identifier<C>, Vec<u8>)>, Error<C>> {
let mut binding_factor_input_prefix = Vec::new();
// The length of a serialized verifying key of the same ciphersuite does
// not change between runs of the protocol, so we don't need to hash to
// get a fixed length.
binding_factor_input_prefix.extend_from_slice(verifying_key.serialize()?.as_ref());
// 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(),