@@ -204,42 +204,13 @@ use crate::ffi::CPtr;
204204pub use crate :: key:: { InvalidParityValue , Keypair , Parity , PublicKey , SecretKey , XOnlyPublicKey } ;
205205pub use crate :: scalar:: Scalar ;
206206
207- /// Trait describing something that promises to be a 32-byte uniformly random number.
208- ///
209- /// In particular, anything implementing this trait must have negligible probability
210- /// of being zero, overflowing the group order, or equalling any specific value.
211- ///
212- /// Since version 0.29 this has been deprecated; users should instead implement
213- /// `Into<Message>` for types that satisfy these properties.
214- #[ deprecated(
215- since = "0.29.0" ,
216- note = "Please see v0.29.0 rust-secp256k1/CHANGELOG.md for suggestion"
217- ) ]
218- pub trait ThirtyTwoByteHash {
219- /// Converts the object into a 32-byte array
220- fn into_32 ( self ) -> [ u8 ; 32 ] ;
221- }
222-
223207/// A (hashed) message input to an ECDSA signature.
224208#[ derive( Copy , Clone , PartialEq , Eq , PartialOrd , Ord , Hash ) ]
225209pub struct Message ( [ u8 ; constants:: MESSAGE_SIZE ] ) ;
226210impl_array_newtype ! ( Message , u8 , constants:: MESSAGE_SIZE ) ;
227211impl_pretty_debug ! ( Message ) ;
228212
229213impl Message {
230- /// Creates a [`Message`] from a 32 byte slice `digest`.
231- ///
232- /// Converts a `MESSAGE_SIZE`-byte slice to a message object. **WARNING:** the slice has to be a
233- /// cryptographically secure hash of the actual message that's going to be signed. Otherwise
234- /// the result of signing isn't a
235- /// [secure signature](https://twitter.com/pwuille/status/1063582706288586752).
236- #[ inline]
237- #[ deprecated( since = "0.28.0" , note = "use from_digest instead" ) ]
238- pub fn from_slice ( digest : & [ u8 ] ) -> Result < Message , Error > {
239- #[ allow( deprecated) ]
240- Message :: from_digest_slice ( digest)
241- }
242-
243214 /// Creates a [`Message`] from a `digest`.
244215 ///
245216 /// The `digest` array has to be a cryptographically secure hash of the actual message that's
@@ -271,12 +242,6 @@ impl Message {
271242 }
272243}
273244
274- #[ allow( deprecated) ]
275- impl < T : ThirtyTwoByteHash > From < T > for Message {
276- /// Converts a 32-byte hash directly to a message without error paths.
277- fn from ( t : T ) -> Message { Message ( t. into_32 ( ) ) }
278- }
279-
280245impl fmt:: LowerHex for Message {
281246 fn fmt ( & self , f : & mut fmt:: Formatter ) -> fmt:: Result {
282247 for byte in self . 0 . iter ( ) {
0 commit comments