Skip to content

Commit c0244ce

Browse files
taiki-eAmanieu
authored andcommitted
std_detect: Remove support for arm crypto target feature
1 parent 7b5d269 commit c0244ce

File tree

4 files changed

+2
-24
lines changed

4 files changed

+2
-24
lines changed

crates/std_detect/src/detect/arch/arm.rs

-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ features! {
1717
/// Polynomial Multiply
1818
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] crc: "crc";
1919
/// CRC32 (Cyclic Redundancy Check)
20-
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] crypto: "crypto";
21-
/// Crypto: AES + PMULL + SHA1 + SHA256. Prefer using the individual features where possible.
2220
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] aes: "aes";
2321
/// FEAT_AES (AES instructions)
2422
@FEATURE: #[unstable(feature = "stdsimd", issue = "27731")] sha2: "sha2";

crates/std_detect/src/detect/os/freebsd/arm.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,13 @@ pub(crate) fn detect_features() -> cache::Initializer {
2323

2424
if let Ok(auxv) = auxvec::auxv() {
2525
enable_feature(&mut value, Feature::neon, auxv.hwcap & HWCAP_NEON != 0);
26-
let pmull = auxv.hwcap2 & HWCAP2_PMULL != 0;
27-
enable_feature(&mut value, Feature::pmull, pmull);
26+
enable_feature(&mut value, Feature::pmull, auxv.hwcap2 & HWCAP2_PMULL != 0);
2827
enable_feature(&mut value, Feature::crc, auxv.hwcap2 & HWCAP2_CRC32 != 0);
29-
let aes = auxv.hwcap2 & HWCAP2_AES != 0;
30-
enable_feature(&mut value, Feature::aes, aes);
28+
enable_feature(&mut value, Feature::aes, auxv.hwcap2 & HWCAP2_AES != 0);
3129
// SHA2 requires SHA1 & SHA2 features
3230
let sha1 = auxv.hwcap2 & HWCAP2_SHA1 != 0;
3331
let sha2 = auxv.hwcap2 & HWCAP2_SHA2 != 0;
3432
enable_feature(&mut value, Feature::sha2, sha1 && sha2);
35-
enable_feature(&mut value, Feature::crypto, aes && pmull && sha1 && sha2);
3633
return value;
3734
}
3835
value

crates/std_detect/src/detect/os/linux/arm.rs

-16
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,6 @@ pub(crate) fn detect_features() -> cache::Initializer {
2020
enable_feature(&mut value, Feature::neon, bit::test(auxv.hwcap, 12));
2121
enable_feature(&mut value, Feature::pmull, bit::test(auxv.hwcap2, 1));
2222
enable_feature(&mut value, Feature::crc, bit::test(auxv.hwcap2, 4));
23-
enable_feature(
24-
&mut value,
25-
Feature::crypto,
26-
bit::test(auxv.hwcap2, 0)
27-
&& bit::test(auxv.hwcap2, 1)
28-
&& bit::test(auxv.hwcap2, 2)
29-
&& bit::test(auxv.hwcap2, 3),
30-
);
3123
enable_feature(&mut value, Feature::aes, bit::test(auxv.hwcap2, 0));
3224
// SHA2 requires SHA1 & SHA2 features
3325
enable_feature(
@@ -47,14 +39,6 @@ pub(crate) fn detect_features() -> cache::Initializer {
4739
);
4840
enable_feature(&mut value, Feature::pmull, c.field("Features").has("pmull"));
4941
enable_feature(&mut value, Feature::crc, c.field("Features").has("crc32"));
50-
enable_feature(
51-
&mut value,
52-
Feature::crypto,
53-
c.field("Features").has("aes")
54-
&& c.field("Features").has("pmull")
55-
&& c.field("Features").has("sha1")
56-
&& c.field("Features").has("sha2"),
57-
);
5842
enable_feature(&mut value, Feature::aes, c.field("Features").has("aes"));
5943
enable_feature(
6044
&mut value,

crates/std_detect/tests/cpu-detection.rs

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ fn arm_linux_or_freebsd() {
2828
println!("neon: {}", is_arm_feature_detected!("neon"));
2929
println!("pmull: {}", is_arm_feature_detected!("pmull"));
3030
println!("crc: {}", is_arm_feature_detected!("crc"));
31-
println!("crypto: {}", is_arm_feature_detected!("crypto"));
3231
println!("aes: {}", is_arm_feature_detected!("aes"));
3332
println!("sha2: {}", is_arm_feature_detected!("sha2"));
3433
}

0 commit comments

Comments
 (0)