hashes: Default to no_std

`hashes` is `no_std` ready, lets default to `no_std`.
This commit is contained in:
Tobin C. Harding 2024-11-04 15:26:54 +11:00
parent 6a4e219c55
commit ba124757c4
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
2 changed files with 8 additions and 5 deletions

View File

@ -50,7 +50,7 @@
//! # } //! # }
//! ``` //! ```
#![cfg_attr(not(feature = "std"), no_std)] #![no_std]
// Experimental features we need. // Experimental features we need.
#![cfg_attr(docsrs, feature(doc_auto_cfg))] #![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![cfg_attr(bench, feature(test))] #![cfg_attr(bench, feature(test))]
@ -70,6 +70,9 @@ extern crate alloc;
extern crate core; extern crate core;
#[cfg(feature = "std")]
extern crate std;
#[cfg(feature = "bitcoin-io")] #[cfg(feature = "bitcoin-io")]
extern crate bitcoin_io as io; extern crate bitcoin_io as io;

View File

@ -491,10 +491,10 @@ impl HashEngine {
fn process_block(&mut self) { fn process_block(&mut self) {
#[cfg(all(feature = "std", any(target_arch = "x86", target_arch = "x86_64")))] #[cfg(all(feature = "std", any(target_arch = "x86", target_arch = "x86_64")))]
{ {
if is_x86_feature_detected!("sse4.1") if std::is_x86_feature_detected!("sse4.1")
&& is_x86_feature_detected!("sha") && std::is_x86_feature_detected!("sha")
&& is_x86_feature_detected!("sse2") && std::is_x86_feature_detected!("sse2")
&& is_x86_feature_detected!("ssse3") && std::is_x86_feature_detected!("ssse3")
{ {
return unsafe { self.process_block_simd_x86_intrinsics() }; return unsafe { self.process_block_simd_x86_intrinsics() };
} }