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// Backwards compatible changes
@@ -233,24 +235,24 @@ pub trait ThirtyTwoByteHash {
233235 fn into_32 ( self ) -> [ u8 ; 32 ] ;
234236}
235237
236- #[ cfg( feature = "bitcoin_hashes " ) ]
237- #[ cfg_attr( docsrs, doc( cfg( feature = "bitcoin_hashes " ) ) ) ]
238+ #[ cfg( feature = "bitcoin-hashes " ) ]
239+ #[ cfg_attr( docsrs, doc( cfg( feature = "bitcoin-hashes " ) ) ) ]
238240impl ThirtyTwoByteHash for hashes:: sha256:: Hash {
239241 fn into_32 ( self ) -> [ u8 ; 32 ] {
240242 self . into_inner ( )
241243 }
242244}
243245
244- #[ cfg( feature = "bitcoin_hashes " ) ]
245- #[ cfg_attr( docsrs, doc( cfg( feature = "bitcoin_hashes " ) ) ) ]
246+ #[ cfg( feature = "bitcoin-hashes " ) ]
247+ #[ cfg_attr( docsrs, doc( cfg( feature = "bitcoin-hashes " ) ) ) ]
246248impl ThirtyTwoByteHash for hashes:: sha256d:: Hash {
247249 fn into_32 ( self ) -> [ u8 ; 32 ] {
248250 self . into_inner ( )
249251 }
250252}
251253
252- #[ cfg( feature = "bitcoin_hashes " ) ]
253- #[ cfg_attr( docsrs, doc( cfg( feature = "bitcoin_hashes " ) ) ) ]
254+ #[ cfg( feature = "bitcoin-hashes " ) ]
255+ #[ cfg_attr( docsrs, doc( cfg( feature = "bitcoin-hashes " ) ) ) ]
254256impl < T : hashes:: sha256t:: Tag > ThirtyTwoByteHash for hashes:: sha256t:: Hash < T > {
255257 fn into_32 ( self ) -> [ u8 ; 32 ] {
256258 self . into_inner ( )
@@ -299,8 +301,8 @@ impl Message {
299301 /// assert_eq!(m1, m2);
300302 /// # }
301303 /// ```
302- #[ cfg( feature = "bitcoin_hashes " ) ]
303- #[ cfg_attr( docsrs, doc( cfg( feature = "bitcoin_hashes " ) ) ) ]
304+ #[ cfg( feature = "bitcoin-hashes " ) ]
305+ #[ cfg_attr( docsrs, doc( cfg( feature = "bitcoin-hashes " ) ) ) ]
304306 pub fn from_hashed_data < H : ThirtyTwoByteHash + hashes:: Hash > ( data : & [ u8 ] ) -> Self {
305307 <H as hashes:: Hash >:: hash ( data) . into ( )
306308 }
@@ -1040,7 +1042,7 @@ mod tests {
10401042 assert ! ( SECP256K1 . verify_ecdsa( & msg, & sig, & pk) . is_ok( ) ) ;
10411043 }
10421044
1043- #[ cfg( feature = "bitcoin_hashes " ) ]
1045+ #[ cfg( feature = "bitcoin-hashes " ) ]
10441046 #[ test]
10451047 fn test_from_hash ( ) {
10461048 use crate :: hashes:: { self , Hash } ;
0 commit comments