Skip to content

Commit 1de4114

Browse files
authored
sha1+sha2: make aarch64 CPU feature detection OS-independent (#276)
`cpufeatures` v0.1.4 can build on any `aarch64` target, not just Linux/macOS ones: RustCrypto/utils#40 This PR bumps the minimum `cpufeatures` requirement to v0.1.4 and removes the OS-specifisms on `aarch64` targets.
1 parent b9093ec commit 1de4114

File tree

5 files changed

+8
-16
lines changed

5 files changed

+8
-16
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sha1/Cargo.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,8 @@ opaque-debug = "0.3"
2121
cfg-if = "1.0"
2222
sha1-asm = { version = "0.4", optional = true }
2323

24-
[target.aarch64-apple-darwin.dependencies]
25-
cpufeatures = "0.1.3"
26-
[target.'cfg(all(target_arch = "aarch64", target_os = "linux"))'.dependencies]
27-
cpufeatures = "0.1.3"
28-
[target.'cfg(any(target_arch = "x86", target_arch = "x86_64"))'.dependencies]
29-
cpufeatures = "0.1.3"
24+
[target.'cfg(any(target_arch = "aarch64", target_arch = "x86_64", target_arch = "x86"))'.dependencies]
25+
cpufeatures = "0.1.4"
3026

3127
[dev-dependencies]
3228
digest = { version = "0.9", features = ["dev"] }

sha1/src/compress.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ cfg_if::cfg_if! {
55
if #[cfg(feature = "force-soft")] {
66
mod soft;
77
use soft::compress as compress_inner;
8-
} else if #[cfg(all(feature = "asm", target_arch = "aarch64", target_os = "linux"))] {
8+
} else if #[cfg(all(feature = "asm", target_arch = "aarch64"))] {
99
mod soft;
1010
mod aarch64;
1111
use aarch64::compress as compress_inner;

sha2/Cargo.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,8 @@ opaque-debug = "0.3"
2121
cfg-if = "1.0"
2222
sha2-asm = { version = "0.6.1", optional = true }
2323

24-
[target.aarch64-apple-darwin.dependencies]
25-
cpufeatures = "0.1.3"
26-
[target.'cfg(all(target_arch = "aarch64", target_os = "linux"))'.dependencies]
27-
cpufeatures = "0.1.3"
28-
[target.'cfg(any(target_arch = "x86", target_arch = "x86_64"))'.dependencies]
29-
cpufeatures = "0.1.3"
24+
[target.'cfg(any(target_arch = "aarch64", target_arch = "x86_64", target_arch = "x86"))'.dependencies]
25+
cpufeatures = "0.1.4"
3026

3127
[dev-dependencies]
3228
digest = { version = "0.9", features = ["dev"] }

sha2/src/sha256.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ cfg_if::cfg_if! {
153153
}
154154
mod x86;
155155
use x86::compress;
156-
} else if #[cfg(all(feature = "asm", target_arch = "aarch64", any(target_os = "macos", target_os = "linux")))] {
156+
} else if #[cfg(all(feature = "asm", target_arch = "aarch64"))] {
157157
mod soft;
158158
mod aarch64;
159159
use aarch64::compress;

0 commit comments

Comments
 (0)