aboutsummaryrefslogtreecommitdiff
path: root/crypto/arch/aarch64/crypto_cpu_caps_windows.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/arch/aarch64/crypto_cpu_caps_windows.c')
-rw-r--r--crypto/arch/aarch64/crypto_cpu_caps_windows.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/crypto/arch/aarch64/crypto_cpu_caps_windows.c b/crypto/arch/aarch64/crypto_cpu_caps_windows.c
new file mode 100644
index 0000000..e7cdded
--- /dev/null
+++ b/crypto/arch/aarch64/crypto_cpu_caps_windows.c
@@ -0,0 +1,36 @@
1/* $OpenBSD: crypto_cpu_caps.c,v 1.2 2024/11/12 13:52:31 jsing Exp $ */
2/*
3 * Copyright (c) 2025 Brent Cook <bcook@openbsd.org>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#include <windows.h>
19
20#include "crypto_arch.h"
21
22/* Machine dependent CPU capabilities. */
23uint64_t crypto_cpu_caps_aarch64;
24
25void
26crypto_cpu_caps_init(void)
27{
28 crypto_cpu_caps_aarch64 = 0;
29
30 if (IsProcessorFeaturePresent(PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE)) {
31 crypto_cpu_caps_aarch64 |= CRYPTO_CPU_CAPS_AARCH64_AES;
32 crypto_cpu_caps_aarch64 |= CRYPTO_CPU_CAPS_AARCH64_PMULL;
33 crypto_cpu_caps_aarch64 |= CRYPTO_CPU_CAPS_AARCH64_SHA1;
34 crypto_cpu_caps_aarch64 |= CRYPTO_CPU_CAPS_AARCH64_SHA2;
35 }
36}