diff --git a/ecdsa/src/hazmat.rs b/ecdsa/src/hazmat.rs index 0c157f63..b63ffc57 100644 --- a/ecdsa/src/hazmat.rs +++ b/ecdsa/src/hazmat.rs @@ -52,6 +52,9 @@ where C: Curve + Arithmetic, SignatureSize: ArrayLength, { + /// Type for recoverable signatures + type RecoverableSignature: signature::Signature + Into>; + /// Try to sign the prehashed message. /// /// Accepts the same arguments as [`SignPrimitive::try_sign_prehashed`] @@ -62,7 +65,7 @@ where &self, ephemeral_scalar: &K, hashed_msg: &ElementBytes, - ) -> Result<(Signature, bool), Error>; + ) -> Result; } impl SignPrimitive for T @@ -76,8 +79,8 @@ where ephemeral_scalar: &K, hashed_msg: &ElementBytes, ) -> Result, Error> { - let (sig, _) = self.try_sign_recoverable_prehashed(ephemeral_scalar, hashed_msg)?; - Ok(sig) + self.try_sign_recoverable_prehashed(ephemeral_scalar, hashed_msg) + .map(Into::into) } }