forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-22 8ac6c7a54ed1b98d142dce24b11c6de6a1e239a5
kernel/arch/arm/crypto/sha1_neon_glue.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Glue code for the SHA1 Secure Hash Algorithm assembler implementation using
34 * ARM NEON instructions.
....@@ -10,19 +11,13 @@
1011 * Copyright (c) Jean-Francois Dive <jef@linuxbe.org>
1112 * Copyright (c) Mathias Krause <minipli@googlemail.com>
1213 * Copyright (c) Chandramouli Narayanan <mouli@linux.intel.com>
13
- *
14
- * This program is free software; you can redistribute it and/or modify it
15
- * under the terms of the GNU General Public License as published by the Free
16
- * Software Foundation; either version 2 of the License, or (at your option)
17
- * any later version.
18
- *
1914 */
2015
2116 #include <crypto/internal/hash.h>
17
+#include <crypto/internal/simd.h>
2218 #include <linux/init.h>
2319 #include <linux/module.h>
2420 #include <linux/mm.h>
25
-#include <linux/cryptohash.h>
2621 #include <linux/types.h>
2722 #include <crypto/sha.h>
2823 #include <crypto/sha1_base.h>
....@@ -39,7 +34,7 @@
3934 {
4035 struct sha1_state *sctx = shash_desc_ctx(desc);
4136
42
- if (!may_use_simd() ||
37
+ if (!crypto_simd_usable() ||
4338 (sctx->count % SHA1_BLOCK_SIZE) + len < SHA1_BLOCK_SIZE)
4439 return sha1_update_arm(desc, data, len);
4540
....@@ -54,7 +49,7 @@
5449 static int sha1_neon_finup(struct shash_desc *desc, const u8 *data,
5550 unsigned int len, u8 *out)
5651 {
57
- if (!may_use_simd())
52
+ if (!crypto_simd_usable())
5853 return sha1_finup_arm(desc, data, len, out);
5954
6055 kernel_neon_begin();