Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions schnorr_fun/src/frost/chilldkg/encpedpop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ impl AggKeygenInput {
let tweak_poly = shared_key.grind_fingerprint::<H>(fingerprint);
// replace our poly with the one that has the fingerprint
self.inner.agg_poly = shared_key.point_polynomial()[1..].to_vec();
debug_assert!(self.shared_key().check_fingerprint::<H>(&fingerprint));
debug_assert!(self.shared_key().check_fingerprint::<H>(fingerprint));

for (share_index, (_encryption_key, encrypted_secret_share)) in &mut self.encrypted_shares {
// 💡 The share encryption is homomorphic so we can apply the tweak
Expand Down Expand Up @@ -566,7 +566,7 @@ mod test {
assert_eq!(shared_key.pair_secret_share(*share.secret_share()), Some(share));
}

assert!(shared_key.check_fingerprint::<sha2::Sha256>(&fingerprint), "fingerprint was grinded correctly");
assert!(shared_key.check_fingerprint::<sha2::Sha256>(fingerprint), "fingerprint was grinded correctly");
}
}
}
7 changes: 2 additions & 5 deletions schnorr_fun/src/frost/shared_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,7 @@ impl<T: Normalized, Z: ZeroChoice> SharedKey<T, Z> {
///
/// Returns `true` if all coefficients match the fingerprint pattern, `false`
/// if any coefficient fails to meet the difficulty requirement.
pub fn check_fingerprint<H: crate::fun::hash::Hash32>(
&self,
fingerprint: &Fingerprint,
) -> bool {
pub fn check_fingerprint<H: crate::fun::hash::Hash32>(&self, fingerprint: Fingerprint) -> bool {
use crate::fun::hash::HashAdd;

// the fingerprint is only placed on the non-constant coefficients so it
Expand Down Expand Up @@ -597,7 +594,7 @@ mod test {

// Verify the fingerprint is valid
assert!(
shared_key.check_fingerprint::<sha2::Sha256>(&fingerprint),
shared_key.check_fingerprint::<sha2::Sha256>(fingerprint),
"Grinded fingerprint should be valid"
);
}
Expand Down