hc
2024-01-05 071106ecf68c401173c58808b1cf5f68cc50d390
kernel/arch/arm64/crypto/sm3-ce-glue.c
....@@ -1,17 +1,15 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * sm3-ce-glue.c - SM3 secure hash using ARMv8.2 Crypto Extensions
34 *
45 * Copyright (C) 2018 Linaro Ltd <ard.biesheuvel@linaro.org>
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 as
8
- * published by the Free Software Foundation.
96 */
107
118 #include <asm/neon.h>
129 #include <asm/simd.h>
1310 #include <asm/unaligned.h>
1411 #include <crypto/internal/hash.h>
12
+#include <crypto/internal/simd.h>
1513 #include <crypto/sm3.h>
1614 #include <crypto/sm3_base.h>
1715 #include <linux/cpufeature.h>
....@@ -28,7 +26,7 @@
2826 static int sm3_ce_update(struct shash_desc *desc, const u8 *data,
2927 unsigned int len)
3028 {
31
- if (!may_use_simd())
29
+ if (!crypto_simd_usable())
3230 return crypto_sm3_update(desc, data, len);
3331
3432 kernel_neon_begin();
....@@ -40,7 +38,7 @@
4038
4139 static int sm3_ce_final(struct shash_desc *desc, u8 *out)
4240 {
43
- if (!may_use_simd())
41
+ if (!crypto_simd_usable())
4442 return crypto_sm3_finup(desc, NULL, 0, out);
4543
4644 kernel_neon_begin();
....@@ -53,7 +51,7 @@
5351 static int sm3_ce_finup(struct shash_desc *desc, const u8 *data,
5452 unsigned int len, u8 *out)
5553 {
56
- if (!may_use_simd())
54
+ if (!crypto_simd_usable())
5755 return crypto_sm3_finup(desc, data, len, out);
5856
5957 kernel_neon_begin();