diff --git a/bls/bls-blst/src/signature.rs b/bls/bls-blst/src/signature.rs index 69042df1..5a48c71d 100644 --- a/bls/bls-blst/src/signature.rs +++ b/bls/bls-blst/src/signature.rs @@ -48,7 +48,7 @@ impl SignatureTrait for Signature { type PublicKey = PublicKey; #[must_use] - fn verify(&self, message: impl AsRef<[u8]>, public_key: &Self::PublicKey) -> bool { + fn verify(&self, message: impl AsRef<[u8]>, public_key: Self::PublicKey) -> bool { let result = self.as_raw().verify( true, message.as_ref(), @@ -149,7 +149,7 @@ mod tests { let public_key = SecretKey::to_public_key(&secret_key); let signature = SecretKey::sign(&secret_key, MESSAGE); - assert!(Signature::verify(&signature, MESSAGE, &public_key)); + assert!(Signature::verify(&signature, MESSAGE, public_key)); } #[test] @@ -158,7 +158,7 @@ mod tests { let public_key = PublicKey::default(); let signature = SecretKey::sign(&secret_key, MESSAGE); - assert!(!Signature::verify(&signature, MESSAGE, &public_key)); + assert!(!Signature::verify(&signature, MESSAGE, public_key)); } #[test] @@ -167,7 +167,7 @@ mod tests { let public_key = SecretKey::to_public_key(&secret_key); let signature = Signature::default(); - assert!(!Signature::verify(&signature, MESSAGE, &public_key)); + assert!(!Signature::verify(&signature, MESSAGE, public_key)); } fn secret_key() -> SecretKey { diff --git a/bls/bls-core/src/traits/signature.rs b/bls/bls-core/src/traits/signature.rs index abac9a83..8a701c3a 100644 --- a/bls/bls-core/src/traits/signature.rs +++ b/bls/bls-core/src/traits/signature.rs @@ -9,7 +9,7 @@ where type SignatureBytes: SignatureBytesTrait; type PublicKey: PublicKeyTrait; - fn verify(&self, message: impl AsRef<[u8]>, public_key: &Self::PublicKey) -> bool; + fn verify(&self, message: impl AsRef<[u8]>, public_key: Self::PublicKey) -> bool; #[must_use] fn aggregate(mut self, other: Self) -> Self { diff --git a/bls/bls-zkcrypto/src/signature.rs b/bls/bls-zkcrypto/src/signature.rs index 419bb2b4..3943b780 100644 --- a/bls/bls-zkcrypto/src/signature.rs +++ b/bls/bls-zkcrypto/src/signature.rs @@ -42,7 +42,7 @@ impl SignatureTrait for Signature { type PublicKey = PublicKey; #[must_use] - fn verify(&self, message: impl AsRef<[u8]>, public_key: &Self::PublicKey) -> bool { + fn verify(&self, message: impl AsRef<[u8]>, public_key: Self::PublicKey) -> bool { let h = >>::hash_to_curve( &[message.as_ref()], DOMAIN_SEPARATION_TAG, @@ -145,7 +145,7 @@ mod tests { let public_key = SecretKey::to_public_key(&secret_key); let signature = SecretKey::sign(&secret_key, MESSAGE); - assert!(Signature::verify(&signature, MESSAGE, &public_key)); + assert!(Signature::verify(&signature, MESSAGE, public_key)); } #[test] @@ -154,7 +154,7 @@ mod tests { let public_key = PublicKey::default(); let signature = SecretKey::sign(&secret_key, MESSAGE); - assert!(!Signature::verify(&signature, MESSAGE, &public_key)); + assert!(!Signature::verify(&signature, MESSAGE, public_key)); } #[test] @@ -163,7 +163,7 @@ mod tests { let public_key = SecretKey::to_public_key(&secret_key); let signature = Signature::default(); - assert!(!Signature::verify(&signature, MESSAGE, &public_key)); + assert!(!Signature::verify(&signature, MESSAGE, public_key)); } fn secret_key() -> SecretKey { diff --git a/helper_functions/src/spec_tests.rs b/helper_functions/src/spec_tests.rs index fdaeef8b..0cb279d0 100644 --- a/helper_functions/src/spec_tests.rs +++ b/helper_functions/src/spec_tests.rs @@ -220,7 +220,7 @@ fn verify(case: Case) { let run = || -> Result<_, Error> { let public_key = PublicKey::try_from(pubkey)?; let signature = Signature::try_from(signature)?; - Ok(signature.verify(message, &public_key)) + Ok(signature.verify(message, public_key)) }; if output { diff --git a/helper_functions/src/verifier.rs b/helper_functions/src/verifier.rs index 80a0a464..56d8f2a7 100644 --- a/helper_functions/src/verifier.rs +++ b/helper_functions/src/verifier.rs @@ -228,7 +228,7 @@ impl Verifier for SingleVerifier { let signature = Signature::try_from(signature_bytes)?; ensure!( - signature.verify(message, &public_key), + signature.verify(message, public_key), Error::SignatureInvalid(signature_kind), ); }