From a03cda2372b3d931f44db2c65634c89441e9204c Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Wed, 2 Sep 2020 16:45:06 -0700 Subject: [PATCH] ecdsa: remove RecoverableSignPrimitive This is really a concern of the `k256` crate and isn't helpful to generalize to other curves. --- ecdsa/src/hazmat.rs | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff --git a/ecdsa/src/hazmat.rs b/ecdsa/src/hazmat.rs index 91846253..3a8ea335 100644 --- a/ecdsa/src/hazmat.rs +++ b/ecdsa/src/hazmat.rs @@ -43,45 +43,6 @@ where ) -> Result, Error>; } -/// [`SignPrimitive`] for signature implementations that can provide public key -/// recovery implementation. -pub trait RecoverableSignPrimitive -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`] - /// but returns a boolean flag which indicates whether or not the - /// y-coordinate of the computed 𝐑 = 𝑘×𝑮 point is odd, which can be - /// incorporated into recoverable signatures. - fn try_sign_recoverable_prehashed + Invert>( - &self, - ephemeral_scalar: &K, - hashed_msg: &C::Scalar, - ) -> Result; -} - -impl SignPrimitive for T -where - C: Curve + Arithmetic, - T: RecoverableSignPrimitive, - SignatureSize: ArrayLength, -{ - fn try_sign_prehashed + Invert>( - &self, - ephemeral_scalar: &K, - hashed_msg: &C::Scalar, - ) -> Result, Error> { - self.try_sign_recoverable_prehashed(ephemeral_scalar, hashed_msg) - .map(Into::into) - } -} - /// Verify the given prehashed message using ECDSA. /// /// This trait is intended to be implemented on type which can access