From f7106f09ed6efde2bd87afe6133e347b57b29af4 Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Thu, 7 Jul 2022 14:28:42 -0400 Subject: [PATCH] Add further must_uses --- coins/monero/src/ringct/bulletproofs.rs | 1 + coins/monero/src/ringct/clsag/multisig.rs | 2 ++ crypto/frost/src/algorithm.rs | 4 ++++ crypto/frost/src/schnorr.rs | 1 + 4 files changed, 8 insertions(+) diff --git a/coins/monero/src/ringct/bulletproofs.rs b/coins/monero/src/ringct/bulletproofs.rs index e6a258d9..46077f2e 100644 --- a/coins/monero/src/ringct/bulletproofs.rs +++ b/coins/monero/src/ringct/bulletproofs.rs @@ -76,6 +76,7 @@ impl Bulletproofs { Ok(res) } + #[must_use] pub fn verify(&self, rng: &mut R, commitments: &[EdwardsPoint]) -> bool { if commitments.len() > 16 { return false; diff --git a/coins/monero/src/ringct/clsag/multisig.rs b/coins/monero/src/ringct/clsag/multisig.rs index 77adc0b1..19fff6a7 100644 --- a/coins/monero/src/ringct/clsag/multisig.rs +++ b/coins/monero/src/ringct/clsag/multisig.rs @@ -227,6 +227,7 @@ impl Algorithm for ClsagMultisig { share } + #[must_use] fn verify( &self, _: dfg::EdwardsPoint, @@ -247,6 +248,7 @@ impl Algorithm for ClsagMultisig { return None; } + #[must_use] fn verify_share( &self, verification_share: dfg::EdwardsPoint, diff --git a/crypto/frost/src/algorithm.rs b/crypto/frost/src/algorithm.rs index 70f6cf92..a85bab11 100644 --- a/crypto/frost/src/algorithm.rs +++ b/crypto/frost/src/algorithm.rs @@ -46,10 +46,12 @@ pub trait Algorithm: Clone { ) -> C::F; /// Verify a signature + #[must_use] fn verify(&self, group_key: C::G, nonce: C::G, sum: C::F) -> Option; /// Verify a specific share given as a response. Used to determine blame if signature /// verification fails + #[must_use] fn verify_share( &self, verification_share: C::G, @@ -145,6 +147,7 @@ impl> Algorithm for Schnorr { schnorr::sign::(params.secret_share(), nonce, c).s } + #[must_use] fn verify(&self, group_key: C::G, nonce: C::G, sum: C::F) -> Option { let sig = SchnorrSignature { R: nonce, s: sum }; if schnorr::verify::(group_key, self.c.unwrap(), &sig) { @@ -154,6 +157,7 @@ impl> Algorithm for Schnorr { } } + #[must_use] fn verify_share( &self, verification_share: C::G, diff --git a/crypto/frost/src/schnorr.rs b/crypto/frost/src/schnorr.rs index dafc8251..6bc63768 100644 --- a/crypto/frost/src/schnorr.rs +++ b/crypto/frost/src/schnorr.rs @@ -33,6 +33,7 @@ pub(crate) fn sign( } } +#[must_use] pub(crate) fn verify( public_key: C::G, challenge: C::F,