From 2788951476803cb391e8eefd6d662356fea54e6f Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Wed, 5 May 2021 08:34:35 -0700 Subject: [PATCH] sha1+sha2: switch from `cpuid-bool` to `cpufeatures` Renamed in this PR: https://github.com/RustCrypto/utils/pull/381 --- Cargo.lock | 10 +++++----- sha1/Cargo.toml | 2 +- sha1/src/compress/x86.rs | 2 +- sha2/Cargo.toml | 2 +- sha2/src/sha256/x86.rs | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aad4c1ea..a0365b0d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -55,10 +55,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "cpuid-bool" -version = "0.2.0" +name = "cpufeatures" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" +checksum = "5cd5a7748210e7ec1a9696610b1015e6e31fbf58f77a160801f124bd1c36592a" [[package]] name = "crypto-mac" @@ -228,7 +228,7 @@ version = "0.9.4" dependencies = [ "block-buffer", "cfg-if", - "cpuid-bool", + "cpufeatures", "digest", "hex-literal", "libc", @@ -251,7 +251,7 @@ version = "0.9.3" dependencies = [ "block-buffer", "cfg-if", - "cpuid-bool", + "cpufeatures", "digest", "hex-literal", "libc", diff --git a/sha1/Cargo.toml b/sha1/Cargo.toml index 25754199..fc305076 100644 --- a/sha1/Cargo.toml +++ b/sha1/Cargo.toml @@ -22,7 +22,7 @@ cfg-if = "1.0" sha1-asm = { version = "0.4", optional = true } [target.'cfg(any(target_arch = "x86", target_arch = "x86_64"))'.dependencies] -cpuid-bool = "0.2" +cpufeatures = "0.1" [target.'cfg(all(target_arch = "aarch64", target_os = "linux"))'.dependencies] libc = { version = "0.2.93", optional = true } diff --git a/sha1/src/compress/x86.rs b/sha1/src/compress/x86.rs index 0c99da5a..f43a9336 100644 --- a/sha1/src/compress/x86.rs +++ b/sha1/src/compress/x86.rs @@ -95,7 +95,7 @@ unsafe fn digest_blocks(state: &mut [u32; 5], blocks: &[[u8; 64]]) { state[4] = _mm_extract_epi32(state_e, 3) as u32; } -cpuid_bool::new!(shani_cpuid, "sha", "sse2", "ssse3", "sse4.1"); +cpufeatures::new!(shani_cpuid, "sha", "sse2", "ssse3", "sse4.1"); pub fn compress(state: &mut [u32; 5], blocks: &[[u8; 64]]) { // TODO: Replace with https://github.com/rust-lang/rfcs/pull/2725 diff --git a/sha2/Cargo.toml b/sha2/Cargo.toml index 5c9cf92e..b03343ab 100644 --- a/sha2/Cargo.toml +++ b/sha2/Cargo.toml @@ -22,7 +22,7 @@ cfg-if = "1.0" sha2-asm = { version = "0.6.1", optional = true } [target.'cfg(any(target_arch = "x86", target_arch = "x86_64"))'.dependencies] -cpuid-bool = "0.2" +cpufeatures = "0.1" [target.'cfg(all(target_arch = "aarch64", target_os = "linux"))'.dependencies] libc = { version = "0.2.93", optional = true } diff --git a/sha2/src/sha256/x86.rs b/sha2/src/sha256/x86.rs index 39cc5329..65ebff78 100644 --- a/sha2/src/sha256/x86.rs +++ b/sha2/src/sha256/x86.rs @@ -95,7 +95,7 @@ unsafe fn digest_blocks(state: &mut [u32; 8], blocks: &[[u8; 64]]) { _mm_storeu_si128(state_ptr_mut.add(1), hgef); } -cpuid_bool::new!(shani_cpuid, "sha", "sse2", "ssse3", "sse4.1"); +cpufeatures::new!(shani_cpuid, "sha", "sse2", "ssse3", "sse4.1"); pub fn compress(state: &mut [u32; 8], blocks: &[[u8; 64]]) { // TODO: Replace with https://github.com/rust-lang/rfcs/pull/2725