Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

signature: Relax Sized requirements on async signer traits #1766

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions signature/src/hazmat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub trait RandomizedPrehashSigner<S> {
///
/// Allowed lengths are algorithm-dependent and up to a particular
/// implementation to decide.
fn sign_prehash_with_rng<R: TryCryptoRng>(
fn sign_prehash_with_rng<R: TryCryptoRng + ?Sized>(
&self,
rng: &mut R,
prehash: &[u8],
Expand Down Expand Up @@ -103,7 +103,7 @@ pub trait AsyncRandomizedPrehashSigner<S> {
///
/// Allowed lengths are algorithm-dependent and up to a particular
/// implementation to decide.
async fn sign_prehash_with_rng_async<R: TryCryptoRng>(
async fn sign_prehash_with_rng_async<R: TryCryptoRng + ?Sized>(
&self,
rng: &mut R,
prehash: &[u8],
Expand Down
6 changes: 3 additions & 3 deletions signature/src/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ where
#[allow(async_fn_in_trait)]
pub trait AsyncRandomizedSigner<S> {
/// Sign the given message and return a digital signature
async fn sign_with_rng_async<R: CryptoRng>(&self, rng: &mut R, msg: &[u8]) -> S {
async fn sign_with_rng_async<R: CryptoRng + ?Sized>(&self, rng: &mut R, msg: &[u8]) -> S {
self.try_sign_with_rng_async(rng, msg)
.await
.expect("signature operation failed")
Expand All @@ -212,7 +212,7 @@ pub trait AsyncRandomizedSigner<S> {
///
/// 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<R: CryptoRng>(
async fn try_sign_with_rng_async<R: TryCryptoRng + ?Sized>(
&self,
rng: &mut R,
msg: &[u8],
Expand All @@ -224,7 +224,7 @@ impl<S, T> AsyncRandomizedSigner<S> for T
where
T: RandomizedSigner<S>,
{
async fn try_sign_with_rng_async<R: CryptoRng>(
async fn try_sign_with_rng_async<R: TryCryptoRng + ?Sized>(
&self,
rng: &mut R,
msg: &[u8],
Expand Down