From 7a86e01eb60e12f0953702f24a8ada49b55355e6 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Wed, 12 Feb 2025 15:52:22 -0700 Subject: [PATCH] signature: async `rand_core` v0.9 updates Followup to #1720 --- signature/src/hazmat.rs | 4 ++-- signature/src/signer.rs | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/signature/src/hazmat.rs b/signature/src/hazmat.rs index cfd274f82..4c549af9c 100644 --- a/signature/src/hazmat.rs +++ b/signature/src/hazmat.rs @@ -99,9 +99,9 @@ pub trait AsyncRandomizedPrehashSigner { /// /// Allowed lengths are algorithm-dependent and up to a particular /// implementation to decide. - async fn sign_prehash_with_rng_async( + async fn sign_prehash_with_rng_async( &self, - rng: &mut impl CryptoRngCore, + rng: &mut R, prehash: &[u8], ) -> Result; } diff --git a/signature/src/signer.rs b/signature/src/signer.rs index dcb322490..a6c2813f8 100644 --- a/signature/src/signer.rs +++ b/signature/src/signer.rs @@ -186,7 +186,7 @@ where #[allow(async_fn_in_trait)] pub trait AsyncRandomizedSigner { /// Sign the given message and return a digital signature - async fn sign_with_rng_async(&self, rng: &mut impl CryptoRngCore, msg: &[u8]) -> S { + async fn sign_with_rng_async(&self, rng: &mut R, msg: &[u8]) -> S { self.try_sign_with_rng_async(rng, msg) .await .expect("signature operation failed") @@ -197,9 +197,9 @@ pub trait AsyncRandomizedSigner { /// /// The main intended use case for signing errors is when communicating /// with external signers, e.g. cloud KMS, HSMs, or other hardware tokens. - async fn try_sign_with_rng_async( + async fn try_sign_with_rng_async( &self, - rng: &mut impl CryptoRngCore, + rng: &mut R, msg: &[u8], ) -> Result; } @@ -209,9 +209,9 @@ impl AsyncRandomizedSigner for T where T: RandomizedSigner, { - async fn try_sign_with_rng_async( + async fn try_sign_with_rng_async( &self, - rng: &mut impl CryptoRngCore, + rng: &mut R, msg: &[u8], ) -> Result { self.try_sign_with_rng(rng, msg)