4141//! trigger any assertion failures in the upstream library.
4242//!
4343//! ```rust
44- //! # #[cfg(all(feature = "std", feature="rand-std", feature="bitcoin_hashes "))] {
44+ //! # #[cfg(all(feature = "std", feature="rand-std", feature="bitcoin-hashes-std "))] {
4545//! use secp256k1::rand::rngs::OsRng;
4646//! use secp256k1::{Secp256k1, Message};
4747//! use secp256k1::hashes::sha256;
5858//! If the "global-context" feature is enabled you have access to an alternate API.
5959//!
6060//! ```rust
61- //! # #[cfg(all(feature="global-context", feature = "std", feature="rand-std", features = "bitcoin_hashes "))] {
61+ //! # #[cfg(all(feature="global-context", feature = "std", feature="rand-std", features = "bitcoin-hashes-std "))] {
6262//! use secp256k1::rand::thread_rng;
6363//! use secp256k1::{generate_keypair, Message};
6464//! use secp256k1::hashes::sha256;
7171//! # }
7272//! ```
7373//!
74- //! The above code requires `rust-secp256k1` to be compiled with the `rand-std` and `bitcoin_hashes `
74+ //! The above code requires `rust-secp256k1` to be compiled with the `rand-std` and `bitcoin-hashes-std `
7575//! feature enabled, to get access to [`generate_keypair`](struct.Secp256k1.html#method.generate_keypair)
7676//! Alternately, keys and messages can be parsed from slices, like
7777//!
8383//! let secret_key = SecretKey::from_slice(&[0xcd; 32]).expect("32 bytes, within curve order");
8484//! let public_key = PublicKey::from_secret_key(&secp, &secret_key);
8585//! // This is unsafe unless the supplied byte slice is the output of a cryptographic hash function.
86- //! // See the above example for how to use this library together with `bitcoin_hashes `.
86+ //! // See the above example for how to use this library together with `bitcoin-hashes-std `.
8787//! let message = Message::from_slice(&[0xab; 32]).expect("32 bytes");
8888//!
8989//! let sig = secp.sign_ecdsa(&message, &secret_key);
141141//! * `alloc` - use the `alloc` standard Rust library to provide heap allocations.
142142//! * `rand` - use `rand` library to provide random generator (e.g. to generate keys).
143143//! * `rand-std` - use `rand` library with its `std` feature enabled. (Implies `rand`.)
144+ //! * `bitcoin-hashes` - use the `bitcoin-hashes` library.
145+ //! * `bitcoin-hashes-std` - use the `bitcoin-hashes` library with its `std` feature enabled (implies `bitcoin-hashes`).
144146//! * `recovery` - enable functions that can compute the public key from signature.
145147//! * `lowmemory` - optimize the library for low-memory environments.
146148//! * `global-context` - enable use of global secp256k1 context (implies `std`).
147149//! * `serde` - implements serialization and deserialization for types in this crate using `serde`.
148150//! **Important**: `serde` encoding is **not** the same as consensus encoding!
149- //! * `bitcoin_hashes` - enables interaction with the `bitcoin-hashes` crate (e.g. conversions).
151+ //!
150152
151153// Coding conventions
152154#![ deny( non_upper_case_globals, non_camel_case_types, non_snake_case) ]
@@ -188,8 +190,8 @@ pub use rand;
188190#[ cfg( feature = "serde" ) ]
189191#[ cfg_attr( docsrs, doc( cfg( feature = "serde" ) ) ) ]
190192pub use serde;
191- #[ cfg( feature = "bitcoin_hashes " ) ]
192- #[ cfg_attr( docsrs, doc( cfg( feature = "bitcoin_hashes " ) ) ) ]
193+ #[ cfg( feature = "bitcoin-hashes " ) ]
194+ #[ cfg_attr( docsrs, doc( cfg( feature = "bitcoin-hashes " ) ) ) ]
193195pub use bitcoin_hashes as hashes;
194196pub use secp256k1_sys as ffi;
195197pub use crate :: key:: { PublicKey , SecretKey } ;
@@ -203,7 +205,7 @@ pub use context::global::SECP256K1;
203205
204206use core:: { fmt, str, mem, marker:: PhantomData } ;
205207use crate :: ffi:: { CPtr , impl_array_newtype, types:: AlignedType } ;
206- #[ cfg( feature = "bitcoin_hashes " ) ]
208+ #[ cfg( feature = "bitcoin-hashes " ) ]
207209use crate :: hashes:: Hash ;
208210
209211/// Trait describing something that promises to be a 32-byte random number; in particular,
@@ -214,24 +216,24 @@ pub trait ThirtyTwoByteHash {
214216 fn into_32 ( self ) -> [ u8 ; 32 ] ;
215217}
216218
217- #[ cfg( feature = "bitcoin_hashes " ) ]
218- #[ cfg_attr( docsrs, doc( cfg( feature = "bitcoin_hashes " ) ) ) ]
219+ #[ cfg( feature = "bitcoin-hashes " ) ]
220+ #[ cfg_attr( docsrs, doc( cfg( feature = "bitcoin-hashes " ) ) ) ]
219221impl ThirtyTwoByteHash for hashes:: sha256:: Hash {
220222 fn into_32 ( self ) -> [ u8 ; 32 ] {
221223 self . into_inner ( )
222224 }
223225}
224226
225- #[ cfg( feature = "bitcoin_hashes " ) ]
226- #[ cfg_attr( docsrs, doc( cfg( feature = "bitcoin_hashes " ) ) ) ]
227+ #[ cfg( feature = "bitcoin-hashes " ) ]
228+ #[ cfg_attr( docsrs, doc( cfg( feature = "bitcoin-hashes " ) ) ) ]
227229impl ThirtyTwoByteHash for hashes:: sha256d:: Hash {
228230 fn into_32 ( self ) -> [ u8 ; 32 ] {
229231 self . into_inner ( )
230232 }
231233}
232234
233- #[ cfg( feature = "bitcoin_hashes " ) ]
234- #[ cfg_attr( docsrs, doc( cfg( feature = "bitcoin_hashes " ) ) ) ]
235+ #[ cfg( feature = "bitcoin-hashes " ) ]
236+ #[ cfg_attr( docsrs, doc( cfg( feature = "bitcoin-hashes " ) ) ) ]
235237impl < T : hashes:: sha256t:: Tag > ThirtyTwoByteHash for hashes:: sha256t:: Hash < T > {
236238 fn into_32 ( self ) -> [ u8 ; 32 ] {
237239 self . into_inner ( )
@@ -280,8 +282,8 @@ impl Message {
280282 /// assert_eq!(m1, m2);
281283 /// # }
282284 /// ```
283- #[ cfg( feature = "bitcoin_hashes " ) ]
284- #[ cfg_attr( docsrs, doc( cfg( feature = "bitcoin_hashes " ) ) ) ]
285+ #[ cfg( feature = "bitcoin-hashes " ) ]
286+ #[ cfg_attr( docsrs, doc( cfg( feature = "bitcoin-hashes " ) ) ) ]
285287 pub fn from_hashed_data < H : ThirtyTwoByteHash + hashes:: Hash > ( data : & [ u8 ] ) -> Self {
286288 <H as hashes:: Hash >:: hash ( data) . into ( )
287289 }
@@ -1021,7 +1023,7 @@ mod tests {
10211023 assert ! ( SECP256K1 . verify_ecdsa( & msg, & sig, & pk) . is_ok( ) ) ;
10221024 }
10231025
1024- #[ cfg( feature = "bitcoin_hashes " ) ]
1026+ #[ cfg( feature = "bitcoin-hashes " ) ]
10251027 #[ test]
10261028 fn test_from_hash ( ) {
10271029 use crate :: hashes:: { self , Hash } ;
0 commit comments