From 9722950e9115f8c1c29c5227e0485ee6285dfb64 Mon Sep 17 00:00:00 2001 From: Arthur Gautier Date: Fri, 14 Feb 2025 15:26:10 -0800 Subject: [PATCH] signature: Prehash should accept a `TryCryptoRng` --- signature/src/hazmat.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/signature/src/hazmat.rs b/signature/src/hazmat.rs index 4c549af9..25cc900a 100644 --- a/signature/src/hazmat.rs +++ b/signature/src/hazmat.rs @@ -9,7 +9,7 @@ use crate::Error; #[cfg(feature = "rand_core")] -use crate::rand_core::CryptoRng; +use crate::rand_core::TryCryptoRng; /// Sign the provided message prehash, returning a digital signature. pub trait PrehashSigner { @@ -43,7 +43,11 @@ pub trait RandomizedPrehashSigner { /// /// Allowed lengths are algorithm-dependent and up to a particular /// implementation to decide. - fn sign_prehash_with_rng(&self, rng: &mut R, prehash: &[u8]) -> Result; + fn sign_prehash_with_rng( + &self, + rng: &mut R, + prehash: &[u8], + ) -> Result; } /// Verify the provided message prehash using `Self` (e.g. a public key) @@ -99,7 +103,7 @@ 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 R, prehash: &[u8],