diff --git a/Cargo.toml b/Cargo.toml index a1958d945..5e12e1c25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ default = ["std"] std = ["alloc", "secp256k1-sys/std"] # allow use of Secp256k1::new and related API that requires an allocator alloc = ["secp256k1-sys/alloc"] -hashes-std = ["std", "hashes/std"] +chf-std = ["std", "chf/std"] rand-std = ["std", "rand", "rand/std", "rand/std_rng"] recovery = ["secp256k1-sys/recovery"] lowmemory = ["secp256k1-sys/lowmemory"] @@ -40,8 +40,8 @@ secp256k1-sys = { version = "0.10.0", default-features = false, path = "./secp25 serde = { version = "1.0.103", default-features = false, optional = true } # You likely only want to enable these if you explicitly do not want to use "std", otherwise enable -# the respective -std feature e.g., hashes-std -hashes = { package = "bitcoin_hashes", version = ">= 0.12, <= 0.14", default-features = false, optional = true } +# the respective -std feature e.g., chf-std +chf = { package = "chf", version = "0.1.0", default-features = false, optional = true } rand = { version = "0.8", default-features = false, optional = true } [dev-dependencies] @@ -57,11 +57,11 @@ getrandom = { version = "0.2", features = ["js"] } [[example]] name = "sign_verify_recovery" -required-features = ["recovery", "hashes-std"] +required-features = ["recovery", "chf-std"] [[example]] name = "sign_verify" -required-features = ["hashes-std"] +required-features = ["chf-std"] [[example]] name = "generate_keys" @@ -70,3 +70,6 @@ required-features = ["rand-std"] [workspace] members = ["secp256k1-sys"] exclude = ["no_std_test"] + +[patch.crates-io.chf] +path = "../../rust-chf" diff --git a/examples/sign_verify.rs b/examples/sign_verify.rs index 46d90e11d..12caa1d9a 100644 --- a/examples/sign_verify.rs +++ b/examples/sign_verify.rs @@ -1,7 +1,4 @@ -extern crate hashes; -extern crate secp256k1; - -use hashes::{sha256, Hash}; +use chf::sha256; use secp256k1::{ecdsa, Error, Message, PublicKey, Secp256k1, SecretKey, Signing, Verification}; fn verify( diff --git a/examples/sign_verify_recovery.rs b/examples/sign_verify_recovery.rs index 2ab43ea06..3828c2b36 100644 --- a/examples/sign_verify_recovery.rs +++ b/examples/sign_verify_recovery.rs @@ -1,7 +1,4 @@ -extern crate hashes; -extern crate secp256k1; - -use hashes::{sha256, Hash}; +use chf::sha256; use secp256k1::{ecdsa, Error, Message, PublicKey, Secp256k1, SecretKey, Signing, Verification}; fn recover( diff --git a/src/ecdh.rs b/src/ecdh.rs index e53dd79dd..b9b98292a 100644 --- a/src/ecdh.rs +++ b/src/ecdh.rs @@ -112,7 +112,7 @@ impl AsRef<[u8]> for SharedSecret { /// ``` /// # #[cfg(all(feature = "hashes-std", feature = "rand-std"))] { /// # use secp256k1::{ecdh, rand, Secp256k1, PublicKey, SecretKey}; -/// # use secp256k1::hashes::{Hash, sha512}; +/// # use secp256k1::hashes::sha512; /// /// let s = Secp256k1::new(); /// let (sk1, pk1) = s.generate_keypair(&mut rand::thread_rng()); @@ -227,7 +227,7 @@ mod tests { #[cfg(not(secp256k1_fuzz))] #[cfg(all(feature = "hashes-std", feature = "rand-std"))] fn hashes_and_sys_generate_same_secret() { - use hashes::{sha256, Hash, HashEngine}; + use hashes::{sha256, HashEngine}; use crate::ecdh::shared_secret_point;