Skip to content

Commit 38934d4

Browse files
Merge rust-bitcoin/rust-secp256k1#854: Delete deprecated code
dc17be42b5ee6b50bfacb26524fd5637d368d1cc Delete deprecated code (Tobin C. Harding) Pull request description: 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`. ACKs for top commit: apoelstra: ACK dc17be42b5ee6b50bfacb26524fd5637d368d1cc; successfully ran local tests Tree-SHA512: 622d6d9daacfe707d4fb088b237c2aef3ed839a8b878041695e58b031b83fb4c9b8c731ebea81bf7ba941e29bcc02e5daf7266b6a632b0759c666b2c99e04b05
2 parents fcbe8df + a8bb67d commit 38934d4

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
@@ -141,19 +141,6 @@ impl Signature {
141141
}
142142
}
143143

144-
/// Obtains a raw pointer suitable for use with FFI functions
145-
#[inline]
146-
#[deprecated(since = "0.25.0", note = "Use Self::as_c_ptr if you need to access the FFI layer")]
147-
pub fn as_ptr(&self) -> *const ffi::Signature { self.as_c_ptr() }
148-
149-
/// Obtains a raw mutable pointer suitable for use with FFI functions
150-
#[inline]
151-
#[deprecated(
152-
since = "0.25.0",
153-
note = "Use Self::as_mut_c_ptr if you need to access the FFI layer"
154-
)]
155-
pub fn as_mut_ptr(&mut self) -> *mut ffi::Signature { self.as_mut_c_ptr() }
156-
157144
#[inline]
158145
/// Serializes the signature in DER format
159146
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
@@ -279,24 +279,6 @@ impl ElligatorSwiftSharedSecret {
279279
pub const fn as_secret_bytes(&self) -> &[u8; 32] { &self.0 }
280280
}
281281

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

309-
#[allow(deprecated)]
310-
impl From<ElligatorSwiftParty> for Party {
311-
fn from(value: ElligatorSwiftParty) -> Self {
312-
match value {
313-
ElligatorSwiftParty::A => Party::Initiator,
314-
ElligatorSwiftParty::B => Party::Responder,
315-
}
316-
}
317-
}
318-
319291
impl Party {
320292
fn to_ffi_int(self) -> c_int {
321293
match self {

src/key/mod.rs

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

8585
impl PublicKey {
86-
/// Obtains a raw const pointer suitable for use with FFI functions.
87-
#[inline]
88-
#[deprecated(since = "0.25.0", note = "Use Self::as_c_ptr if you need to access the FFI layer")]
89-
pub fn as_ptr(&self) -> *const ffi::PublicKey { self.as_c_ptr() }
90-
91-
/// Obtains a raw mutable pointer suitable for use with FFI functions.
92-
#[inline]
93-
#[deprecated(
94-
since = "0.25.0",
95-
note = "Use Self::as_mut_c_ptr if you need to access the FFI layer"
96-
)]
97-
pub fn as_mut_ptr(&mut self) -> *mut ffi::PublicKey { self.as_mut_c_ptr() }
98-
9986
/// Creates a new public key from a [`SecretKey`].
10087
///
10188
/// # Examples
@@ -497,19 +484,6 @@ pub struct Keypair(ffi::Keypair);
497484
impl_fast_comparisons!(Keypair);
498485

499486
impl Keypair {
500-
/// Obtains a raw const pointer suitable for use with FFI functions.
501-
#[inline]
502-
#[deprecated(since = "0.25.0", note = "Use Self::as_c_ptr if you need to access the FFI layer")]
503-
pub fn as_ptr(&self) -> *const ffi::Keypair { self.as_c_ptr() }
504-
505-
/// Obtains a raw mutable pointer suitable for use with FFI functions.
506-
#[inline]
507-
#[deprecated(
508-
since = "0.25.0",
509-
note = "Use Self::as_mut_c_ptr if you need to access the FFI layer"
510-
)]
511-
pub fn as_mut_ptr(&mut self) -> *mut ffi::Keypair { self.as_mut_c_ptr() }
512-
513487
/// Creates a [`Keypair`] directly from a Secp256k1 secret key.
514488
#[inline]
515489
pub fn from_secret_key(sk: &SecretKey) -> Keypair {
@@ -873,19 +847,6 @@ impl str::FromStr for XOnlyPublicKey {
873847
}
874848

875849
impl XOnlyPublicKey {
876-
/// Obtains a raw const pointer suitable for use with FFI functions.
877-
#[inline]
878-
#[deprecated(since = "0.25.0", note = "Use Self::as_c_ptr if you need to access the FFI layer")]
879-
pub fn as_ptr(&self) -> *const ffi::XOnlyPublicKey { self.as_c_ptr() }
880-
881-
/// Obtains a raw mutable pointer suitable for use with FFI functions.
882-
#[inline]
883-
#[deprecated(
884-
since = "0.25.0",
885-
note = "Use Self::as_mut_c_ptr if you need to access the FFI layer"
886-
)]
887-
pub fn as_mut_ptr(&mut self) -> *mut ffi::XOnlyPublicKey { self.as_mut_c_ptr() }
888-
889850
/// Returns the [`XOnlyPublicKey`] (and its [`Parity`]) for `keypair`.
890851
#[inline]
891852
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
@@ -208,42 +208,13 @@ pub use crate::{
208208
scalar::Scalar,
209209
};
210210

211-
/// Trait describing something that promises to be a 32-byte uniformly random number.
212-
///
213-
/// In particular, anything implementing this trait must have negligible probability
214-
/// of being zero, overflowing the group order, or equalling any specific value.
215-
///
216-
/// Since version 0.29 this has been deprecated; users should instead implement
217-
/// `Into<Message>` for types that satisfy these properties.
218-
#[deprecated(
219-
since = "0.29.0",
220-
note = "Please see v0.29.0 rust-secp256k1/CHANGELOG.md for suggestion"
221-
)]
222-
pub trait ThirtyTwoByteHash {
223-
/// Converts the object into a 32-byte array
224-
fn into_32(self) -> [u8; 32];
225-
}
226-
227211
/// A (hashed) message input to an ECDSA signature.
228212
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
229213
pub struct Message([u8; constants::MESSAGE_SIZE]);
230214
impl_array_newtype!(Message, u8, constants::MESSAGE_SIZE);
231215
impl_pretty_debug!(Message);
232216

233217
impl Message {
234-
/// Creates a [`Message`] from a 32 byte slice `digest`.
235-
///
236-
/// Converts a `MESSAGE_SIZE`-byte slice to a message object. **WARNING:** the slice has to be a
237-
/// cryptographically secure hash of the actual message that's going to be signed. Otherwise
238-
/// the result of signing isn't a
239-
/// [secure signature](https://twitter.com/pwuille/status/1063582706288586752).
240-
#[inline]
241-
#[deprecated(since = "0.28.0", note = "use from_digest instead")]
242-
pub fn from_slice(digest: &[u8]) -> Result<Message, Error> {
243-
#[allow(deprecated)]
244-
Message::from_digest_slice(digest)
245-
}
246-
247218
/// Creates a [`Message`] from a `digest`.
248219
///
249220
/// The `digest` array has to be a cryptographically secure hash of the actual message that's
@@ -275,12 +246,6 @@ impl Message {
275246
}
276247
}
277248

278-
#[allow(deprecated)]
279-
impl<T: ThirtyTwoByteHash> From<T> for Message {
280-
/// Converts a 32-byte hash directly to a message without error paths.
281-
fn from(t: T) -> Message { Message(t.into_32()) }
282-
}
283-
284249
impl fmt::LowerHex for Message {
285250
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
286251
for byte in self.0.iter() {

0 commit comments

Comments
 (0)