Skip to content

Commit 7febf15

Browse files
authored
ecdsa: restore RandomizedSigner<der::Signature> (#960)
1 parent 2c8b508 commit 7febf15

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

ecdsa/src/signing.rs

+18
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,24 @@ where
346346
}
347347
}
348348

349+
#[cfg(feature = "der")]
350+
impl<C> RandomizedSigner<der::Signature<C>> for SigningKey<C>
351+
where
352+
C: EcdsaCurve + CurveArithmetic + DigestPrimitive,
353+
Scalar<C>: Invert<Output = CtOption<Scalar<C>>>,
354+
SignatureSize<C>: ArraySize,
355+
der::MaxSize<C>: ArraySize,
356+
<FieldBytesSize<C> as Add>::Output: Add<der::MaxOverhead> + ArraySize,
357+
{
358+
fn try_sign_with_rng<R: TryCryptoRng + ?Sized>(
359+
&self,
360+
rng: &mut R,
361+
msg: &[u8],
362+
) -> Result<der::Signature<C>> {
363+
RandomizedSigner::<Signature<C>>::try_sign_with_rng(self, rng, msg).map(Into::into)
364+
}
365+
}
366+
349367
//
350368
// Other trait impls
351369
//

0 commit comments

Comments
 (0)