|
3 | 3 | use crate::error::Error; |
4 | 4 |
|
5 | 5 | #[cfg(feature = "digest")] |
6 | | -use crate::{PrehashSignature, digest::Digest}; |
| 6 | +use crate::digest::Digest; |
7 | 7 |
|
8 | 8 | #[cfg(feature = "rand_core")] |
9 | 9 | use crate::rand_core::{CryptoRng, TryCryptoRng}; |
@@ -82,17 +82,6 @@ pub trait DigestSigner<D: Digest, S> { |
82 | 82 | fn try_sign_digest(&self, digest: D) -> Result<S, Error>; |
83 | 83 | } |
84 | 84 |
|
85 | | -#[cfg(feature = "digest")] |
86 | | -impl<S, T> Signer<S> for T |
87 | | -where |
88 | | - S: PrehashSignature, |
89 | | - T: DigestSigner<S::Digest, S>, |
90 | | -{ |
91 | | - fn try_sign(&self, msg: &[u8]) -> Result<S, Error> { |
92 | | - self.try_sign_digest(S::Digest::new_with_prefix(msg)) |
93 | | - } |
94 | | -} |
95 | | - |
96 | 85 | /// Sign the given message using the provided external randomness source. |
97 | 86 | #[cfg(feature = "rand_core")] |
98 | 87 | pub trait RandomizedSigner<S> { |
@@ -135,21 +124,6 @@ pub trait RandomizedDigestSigner<D: Digest, S> { |
135 | 124 | ) -> Result<S, Error>; |
136 | 125 | } |
137 | 126 |
|
138 | | -#[cfg(all(feature = "digest", feature = "rand_core"))] |
139 | | -impl<S, T> RandomizedSigner<S> for T |
140 | | -where |
141 | | - S: PrehashSignature, |
142 | | - T: RandomizedDigestSigner<S::Digest, S>, |
143 | | -{ |
144 | | - fn try_sign_with_rng<R: TryCryptoRng + ?Sized>( |
145 | | - &self, |
146 | | - rng: &mut R, |
147 | | - msg: &[u8], |
148 | | - ) -> Result<S, Error> { |
149 | | - self.try_sign_digest_with_rng(rng, S::Digest::new_with_prefix(msg)) |
150 | | - } |
151 | | -} |
152 | | - |
153 | 127 | /// Sign the provided message bytestring using `&mut Self` (e.g. an evolving |
154 | 128 | /// cryptographic key such as a stateful hash-based signature), and a per-signature |
155 | 129 | /// randomizer, returning a digital signature. |
|
0 commit comments