forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/arch/arm/crypto/sha2-ce-glue.c
....@@ -1,14 +1,12 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * sha2-ce-glue.c - SHA-224/SHA-256 using ARMv8 Crypto Extensions
34 *
45 * Copyright (C) 2015 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 <crypto/internal/hash.h>
9
+#include <crypto/internal/simd.h>
1210 #include <crypto/sha.h>
1311 #include <crypto/sha256_base.h>
1412 #include <linux/cpufeature.h>
....@@ -34,7 +32,7 @@
3432 {
3533 struct sha256_state *sctx = shash_desc_ctx(desc);
3634
37
- if (!may_use_simd() ||
35
+ if (!crypto_simd_usable() ||
3836 (sctx->count % SHA256_BLOCK_SIZE) + len < SHA256_BLOCK_SIZE)
3937 return crypto_sha256_arm_update(desc, data, len);
4038
....@@ -49,7 +47,7 @@
4947 static int sha2_ce_finup(struct shash_desc *desc, const u8 *data,
5048 unsigned int len, u8 *out)
5149 {
52
- if (!may_use_simd())
50
+ if (!crypto_simd_usable())
5351 return crypto_sha256_arm_finup(desc, data, len, out);
5452
5553 kernel_neon_begin();