Skip to content

Commit f440a4f

Browse files
committed
remove use of 'hashes' from public API
We had an impl of the (deprecated) ThirtyTwoByte hash trait, which we no longer use; we delete this. Also remove the 'hashes' feature gate from a unit test that no longer needs it. There is also a `pub extern crate hashes` in src/lib.rs which we should remove here, but it's used in some doctests so we'll remove it in the next commit.
1 parent 26b0a87 commit f440a4f

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ unexpected_cfgs = { level = "deny", check-cfg = ['cfg(bench)', 'cfg(secp256k1_fu
5858

5959
[[example]]
6060
name = "sign_verify_recovery"
61-
required-features = ["recovery", "hashes", "std"]
61+
required-features = ["recovery", "std"]
6262

6363
[[example]]
6464
name = "sign_verify"
65-
required-features = ["hashes", "std"]
65+
required-features = ["std"]
6666

6767
[[example]]
6868
name = "generate_keys"

src/key.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ use crate::ellswift::ElligatorSwift;
1616
use crate::ffi::types::c_uint;
1717
use crate::ffi::{self, CPtr};
1818
use crate::Error::{self, InvalidPublicKey, InvalidPublicKeySum, InvalidSecretKey};
19-
#[cfg(feature = "hashes")]
20-
#[allow(deprecated)]
21-
use crate::ThirtyTwoByteHash;
2219
#[cfg(feature = "global-context")]
2320
use crate::SECP256K1;
2421
use crate::{
@@ -371,15 +368,6 @@ impl SecretKey {
371368
}
372369
}
373370

374-
#[cfg(feature = "hashes")]
375-
#[allow(deprecated)]
376-
impl<T: ThirtyTwoByteHash> From<T> for SecretKey {
377-
/// Converts a 32-byte hash directly to a secret key without error paths.
378-
fn from(t: T) -> SecretKey {
379-
SecretKey::from_byte_array(t.into_32()).expect("failed to create secret key")
380-
}
381-
}
382-
383371
#[cfg(feature = "serde")]
384372
impl serde::Serialize for SecretKey {
385373
fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
@@ -1889,7 +1877,7 @@ mod test {
18891877
}
18901878

18911879
#[test]
1892-
#[cfg(all(feature = "rand", feature = "alloc", not(feature = "hashes")))]
1880+
#[cfg(all(feature = "rand", feature = "alloc"))]
18931881
fn test_debug_output() {
18941882
let s = Secp256k1::new();
18951883
let (sk, _) = s.generate_keypair(&mut StepRng::new(1, 1));

0 commit comments

Comments
 (0)