mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-09 06:39:25 +00:00
bb2f765e5d
add iam store feat: add crypto crate introduce decrypt_data and encrypt_data functions Signed-off-by: bestgopher <84328409@qq.com>
19 lines
783 B
Rust
19 lines
783 B
Rust
pub fn native_aes() -> bool {
|
|
cfg_if::cfg_if! {
|
|
if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] {
|
|
std::is_x86_feature_detected!("aes") && std::is_x86_feature_detected!("pclmulqdq")
|
|
} else if #[cfg(target_arch = "aarch64")] {
|
|
std::arch::is_aarch64_feature_detected!("aes")
|
|
} else if #[cfg(target_arch = "powerpc64")] {
|
|
false
|
|
} else if #[cfg(target_arch = "s390x")] {
|
|
std::is_s390x_feature_detected!("aes")
|
|
&& std::is_s390x_feature_detected!("aescbc")
|
|
&& std::is_s390x_feature_detected!("aesctr")
|
|
&& (std::is_s390x_feature_detected!("aesgcm") || std::is_s390x_feature_detected!("ghash"))
|
|
} else {
|
|
false
|
|
}
|
|
}
|
|
}
|