Skip to content

Commit

Permalink
[schnorr] Make Signature Copy
Browse files Browse the repository at this point in the history
  • Loading branch information
LLFourn committed Jul 31, 2024
1 parent 31f8126 commit de7acf3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion schnorr_fun/benches/bench_schnorr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fn verify_schnorr(c: &mut Criterion) {
});

{
let sig = sig.clone().set_secrecy::<Secret>();
let sig = sig.set_secrecy::<Secret>();
group.bench_function("fun::schnorr_verify_ct", |b| {
b.iter(|| schnorr.verify(verification_key, message, &sig))
});
Expand Down
5 changes: 1 addition & 4 deletions schnorr_fun/src/frost/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -504,10 +504,7 @@ impl<H: Digest<OutputSize = U32> + Clone, NG: NonceGen> Frost<H, NG> {
.map(|(gen_party_index, (party_shares, pop))| {
(
*gen_party_index,
(
party_shares.remove(receiver_party_index).unwrap(),
pop.clone(),
),
(party_shares.remove(receiver_party_index).unwrap(), *pop),
)
})
.collect::<BTreeMap<_, _>>();
Expand Down
2 changes: 1 addition & 1 deletion schnorr_fun/src/signature.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::fun::{marker::*, rand_core::RngCore, Point, Scalar};

/// A Schnorr signature.
#[derive(Clone, Eq)]
#[derive(Clone, Eq, Copy)]
pub struct Signature<S = Public> {
/// The signature's public nonce
///
Expand Down
2 changes: 1 addition & 1 deletion schnorr_fun/tests/frost_prop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ proptest! {
signatures.values().cloned()
);

assert_eq!(proto.verify_and_combine_signature_shares(&xonly_shared_key, &coord_signing_session, signatures), Ok(combined_sig.clone()));
assert_eq!(proto.verify_and_combine_signature_shares(&xonly_shared_key, &coord_signing_session, signatures), Ok(combined_sig));
assert!(proto.schnorr.verify(
&xonly_shared_key.public_key(),
message,
Expand Down

0 comments on commit de7acf3

Please sign in to comment.