Skip to content

Commit dc17be4

Browse files
committed
Delete deprecated code
I don't know the exact policy here in this repo but following along from `rust-bitcoin` delete all deprecated code from at least 2 releases ago - assuming the next release is going to be `v0.32.0`.
1 parent 7d8d547 commit dc17be4

File tree

5 files changed

+0
-128
lines changed

5 files changed

+0
-128
lines changed

src/ecdsa/mod.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -145,19 +145,6 @@ impl Signature {
145145
}
146146
}
147147

148-
/// Obtains a raw pointer suitable for use with FFI functions
149-
#[inline]
150-
#[deprecated(since = "0.25.0", note = "Use Self::as_c_ptr if you need to access the FFI layer")]
151-
pub fn as_ptr(&self) -> *const ffi::Signature { self.as_c_ptr() }
152-
153-
/// Obtains a raw mutable pointer suitable for use with FFI functions
154-
#[inline]
155-
#[deprecated(
156-
since = "0.25.0",
157-
note = "Use Self::as_mut_c_ptr if you need to access the FFI layer"
158-
)]
159-
pub fn as_mut_ptr(&mut self) -> *mut ffi::Signature { self.as_mut_c_ptr() }
160-
161148
#[inline]
162149
/// Serializes the signature in DER format
163150
pub fn serialize_der(&self) -> SerializedSignature {

src/ecdsa/recovery.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,6 @@ impl RecoverableSignature {
9292
}
9393
}
9494

95-
/// Obtains a raw pointer suitable for use with FFI functions.
96-
#[inline]
97-
#[deprecated(since = "0.25.0", note = "Use Self::as_c_ptr if you need to access the FFI layer")]
98-
pub fn as_ptr(&self) -> *const ffi::RecoverableSignature { self.as_c_ptr() }
99-
100-
/// Obtains a raw mutable pointer suitable for use with FFI functions.
101-
#[inline]
102-
#[deprecated(
103-
since = "0.25.0",
104-
note = "Use Self::as_mut_c_ptr if you need to access the FFI layer"
105-
)]
106-
pub fn as_mut_ptr(&mut self) -> *mut ffi::RecoverableSignature { self.as_mut_c_ptr() }
107-
10895
#[inline]
10996
/// Serializes the recoverable signature in compact format.
11097
pub fn serialize_compact(&self) -> (RecoveryId, [u8; 64]) {

src/ellswift.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -282,24 +282,6 @@ impl ElligatorSwiftSharedSecret {
282282
pub const fn as_secret_bytes(&self) -> &[u8; 32] { &self.0 }
283283
}
284284

285-
/// Represents which party we are in the ECDH.
286-
///
287-
/// Here `A` is the initiator and `B` is the responder.
288-
///
289-
/// this context, "we" means the party that possesses the secret key passed to
290-
/// [`ElligatorSwift::shared_secret`].
291-
///
292-
/// This distinction is important because the different parties compute different
293-
/// hashes of the shared secret.
294-
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
295-
#[deprecated(since = "0.30.0", note = "Use `Party` instead.")]
296-
pub enum ElligatorSwiftParty {
297-
/// We are the initiator of the ECDH
298-
A,
299-
/// We are the responder of the ECDH
300-
B,
301-
}
302-
303285
/// Represents the two parties in ECDH
304286
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
305287
pub enum Party {
@@ -309,16 +291,6 @@ pub enum Party {
309291
Responder,
310292
}
311293

312-
#[allow(deprecated)]
313-
impl From<ElligatorSwiftParty> for Party {
314-
fn from(value: ElligatorSwiftParty) -> Self {
315-
match value {
316-
ElligatorSwiftParty::A => Party::Initiator,
317-
ElligatorSwiftParty::B => Party::Responder,
318-
}
319-
}
320-
}
321-
322294
impl Party {
323295
fn to_ffi_int(self) -> c_int {
324296
match self {

src/key/mod.rs

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,6 @@ impl str::FromStr for PublicKey {
8989
}
9090

9191
impl PublicKey {
92-
/// Obtains a raw const pointer suitable for use with FFI functions.
93-
#[inline]
94-
#[deprecated(since = "0.25.0", note = "Use Self::as_c_ptr if you need to access the FFI layer")]
95-
pub fn as_ptr(&self) -> *const ffi::PublicKey { self.as_c_ptr() }
96-
97-
/// Obtains a raw mutable pointer suitable for use with FFI functions.
98-
#[inline]
99-
#[deprecated(
100-
since = "0.25.0",
101-
note = "Use Self::as_mut_c_ptr if you need to access the FFI layer"
102-
)]
103-
pub fn as_mut_ptr(&mut self) -> *mut ffi::PublicKey { self.as_mut_c_ptr() }
104-
10592
/// Creates a new public key from a [`SecretKey`].
10693
///
10794
/// # Examples
@@ -505,19 +492,6 @@ pub struct Keypair(ffi::Keypair);
505492
impl_fast_comparisons!(Keypair);
506493

507494
impl Keypair {
508-
/// Obtains a raw const pointer suitable for use with FFI functions.
509-
#[inline]
510-
#[deprecated(since = "0.25.0", note = "Use Self::as_c_ptr if you need to access the FFI layer")]
511-
pub fn as_ptr(&self) -> *const ffi::Keypair { self.as_c_ptr() }
512-
513-
/// Obtains a raw mutable pointer suitable for use with FFI functions.
514-
#[inline]
515-
#[deprecated(
516-
since = "0.25.0",
517-
note = "Use Self::as_mut_c_ptr if you need to access the FFI layer"
518-
)]
519-
pub fn as_mut_ptr(&mut self) -> *mut ffi::Keypair { self.as_mut_c_ptr() }
520-
521495
/// Creates a [`Keypair`] directly from a Secp256k1 secret key.
522496
#[inline]
523497
pub fn from_secret_key<C: Signing>(secp: &Secp256k1<C>, sk: &SecretKey) -> Keypair {
@@ -867,19 +841,6 @@ impl str::FromStr for XOnlyPublicKey {
867841
}
868842

869843
impl XOnlyPublicKey {
870-
/// Obtains a raw const pointer suitable for use with FFI functions.
871-
#[inline]
872-
#[deprecated(since = "0.25.0", note = "Use Self::as_c_ptr if you need to access the FFI layer")]
873-
pub fn as_ptr(&self) -> *const ffi::XOnlyPublicKey { self.as_c_ptr() }
874-
875-
/// Obtains a raw mutable pointer suitable for use with FFI functions.
876-
#[inline]
877-
#[deprecated(
878-
since = "0.25.0",
879-
note = "Use Self::as_mut_c_ptr if you need to access the FFI layer"
880-
)]
881-
pub fn as_mut_ptr(&mut self) -> *mut ffi::XOnlyPublicKey { self.as_mut_c_ptr() }
882-
883844
/// Returns the [`XOnlyPublicKey`] (and its [`Parity`]) for `keypair`.
884845
#[inline]
885846
pub fn from_keypair(keypair: &Keypair) -> (XOnlyPublicKey, Parity) {

src/lib.rs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -204,42 +204,13 @@ use crate::ffi::CPtr;
204204
pub use crate::key::{InvalidParityValue, Keypair, Parity, PublicKey, SecretKey, XOnlyPublicKey};
205205
pub 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)]
225209
pub struct Message([u8; constants::MESSAGE_SIZE]);
226210
impl_array_newtype!(Message, u8, constants::MESSAGE_SIZE);
227211
impl_pretty_debug!(Message);
228212

229213
impl 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-
280245
impl fmt::LowerHex for Message {
281246
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
282247
for byte in self.0.iter() {

0 commit comments

Comments
 (0)