Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,6 @@ libc = { version = "0.2.172", default-features = false }
[target.'cfg(all(all(target_arch = "aarch64", target_endian = "little"), target_vendor = "apple", any(target_os = "ios", target_os = "macos", target_os = "tvos", target_os = "visionos", target_os = "watchos")))'.dependencies]
libc = { version = "0.2.172", default-features = false }

[target.'cfg(all(all(target_arch = "aarch64", target_endian = "little"), target_os = "windows"))'.dependencies]
windows-sys = { version = "0.61.2", features = ["Win32_Foundation", "Win32_System_Threading"] }

[target.'cfg(all(target_arch = "wasm32", target_os = "unknown"))'.dev-dependencies]
wasm-bindgen-test = { version = "0.3.64", default-features = false, features = ["std"] }

Expand Down
11 changes: 8 additions & 3 deletions src/cpu/aarch64/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@
// CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

use super::{Aes, CAPS_STATIC, Neon, PMull, Sha256};
use windows_sys::Win32::System::Threading::{
IsProcessorFeaturePresent, PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE,
};

pub const FORCE_DYNAMIC_DETECTION: u32 = 0;
/// This Arm processor implements the Arm v8 extra cryptographic instructions (for example, AES, SHA1 and SHA2).
const PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE: u32 = 30;
Comment thread
Jake-Shadle marked this conversation as resolved.
Outdated

#[link(name = "kernel32")]
extern "system" {
Comment thread
Jake-Shadle marked this conversation as resolved.
Outdated
/// <https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-isprocessorfeaturepresent>
fn IsProcessorFeaturePresent(processor_feature: u32) -> i32;
}

pub fn detect_features() -> u32 {
// We do not need to check for the presence of NEON, as Armv8-A always has it
Expand Down