Skip to content

Commit e043576

Browse files
committed
Depend on new chf crate
1 parent 6648126 commit e043576

File tree

5 files changed

+14
-20
lines changed

5 files changed

+14
-20
lines changed

Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ default = ["std"]
2222
std = ["alloc", "secp256k1-sys/std"]
2323
# allow use of Secp256k1::new and related API that requires an allocator
2424
alloc = ["secp256k1-sys/alloc"]
25-
hashes-std = ["std", "hashes/std"]
25+
chf-std = ["std", "chf/std"]
2626
rand-std = ["std", "rand", "rand/std", "rand/std_rng"]
2727
recovery = ["secp256k1-sys/recovery"]
2828
lowmemory = ["secp256k1-sys/lowmemory"]
@@ -40,8 +40,8 @@ secp256k1-sys = { version = "0.10.0", default-features = false, path = "./secp25
4040
serde = { version = "1.0.103", default-features = false, optional = true }
4141

4242
# You likely only want to enable these if you explicitly do not want to use "std", otherwise enable
43-
# the respective -std feature e.g., hashes-std
44-
hashes = { package = "bitcoin_hashes", version = ">= 0.12, <= 0.14", default-features = false, optional = true }
43+
# the respective -std feature e.g., chf-std
44+
chf = { package = "chf", version = "0.1.0", default-features = false, optional = true }
4545
rand = { version = "0.8", default-features = false, optional = true }
4646

4747
[dev-dependencies]
@@ -57,11 +57,11 @@ getrandom = { version = "0.2", features = ["js"] }
5757

5858
[[example]]
5959
name = "sign_verify_recovery"
60-
required-features = ["recovery", "hashes-std"]
60+
required-features = ["recovery", "chf-std"]
6161

6262
[[example]]
6363
name = "sign_verify"
64-
required-features = ["hashes-std"]
64+
required-features = ["chf-std"]
6565

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

contrib/_test.sh

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -ex
44

55
REPO_DIR=$(git rev-parse --show-toplevel)
6-
FEATURES="hashes global-context lowmemory rand recovery serde std alloc hashes-std rand-std"
6+
FEATURES="chf global-context lowmemory rand recovery serde std alloc chf-std rand-std"
77

88
cargo --version
99
rustc --version
@@ -62,16 +62,16 @@ if [ "$DO_FEATURE_MATRIX" = true ]; then
6262
fi
6363

6464
# Examples
65-
cargo run --locked --example sign_verify --features=hashes-std
66-
cargo run --locked --example sign_verify_recovery --features=recovery,hashes-std
65+
cargo run --locked --example sign_verify --features=chf-std
66+
cargo run --locked --example sign_verify_recovery --features=recovery,chf-std
6767
cargo run --locked --example generate_keys --features=rand-std
6868
fi
6969

7070
if [ "$DO_LINT" = true ]
7171
then
7272
cargo clippy --locked --all-features --all-targets -- -D warnings
73-
cargo clippy --locked --example sign_verify --features=hashes-std -- -D warnings
74-
cargo clippy --locked --example sign_verify_recovery --features=recovery,hashes-std -- -D warnings
73+
cargo clippy --locked --example sign_verify --features=chf-std -- -D warnings
74+
cargo clippy --locked --example sign_verify_recovery --features=recovery,chf-std -- -D warnings
7575
cargo clippy --locked --example generate_keys --features=rand-std -- -D warnings
7676
fi
7777

examples/sign_verify.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
extern crate hashes;
2-
extern crate secp256k1;
3-
4-
use hashes::{sha256, Hash};
1+
use chf::sha256;
52
use secp256k1::{ecdsa, Error, Message, PublicKey, Secp256k1, SecretKey, Signing, Verification};
63

74
fn verify<C: Verification>(

examples/sign_verify_recovery.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
extern crate hashes;
2-
extern crate secp256k1;
3-
4-
use hashes::{sha256, Hash};
1+
use chf::sha256;
52
use secp256k1::{ecdsa, Error, Message, PublicKey, Secp256k1, SecretKey, Signing, Verification};
63

74
fn recover<C: Verification>(

src/ecdh.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl AsRef<[u8]> for SharedSecret {
112112
/// ```
113113
/// # #[cfg(all(feature = "hashes-std", feature = "rand-std"))] {
114114
/// # use secp256k1::{ecdh, rand, Secp256k1, PublicKey, SecretKey};
115-
/// # use secp256k1::hashes::{Hash, sha512};
115+
/// # use secp256k1::hashes::sha512;
116116
///
117117
/// let s = Secp256k1::new();
118118
/// let (sk1, pk1) = s.generate_keypair(&mut rand::thread_rng());
@@ -227,7 +227,7 @@ mod tests {
227227
#[cfg(not(secp256k1_fuzz))]
228228
#[cfg(all(feature = "hashes-std", feature = "rand-std"))]
229229
fn hashes_and_sys_generate_same_secret() {
230-
use hashes::{sha256, Hash, HashEngine};
230+
use hashes::{sha256, HashEngine};
231231

232232
use crate::ecdh::shared_secret_point;
233233

0 commit comments

Comments
 (0)