hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/arm64/crypto/sha512-glue.c
....@@ -1,17 +1,11 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Linux/arm64 port of the OpenSSL SHA512 implementation for AArch64
34 *
45 * Copyright (c) 2016 Linaro Ltd. <ard.biesheuvel@linaro.org>
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms of the GNU General Public License as published by the Free
8
- * Software Foundation; either version 2 of the License, or (at your option)
9
- * any later version.
10
- *
116 */
127
138 #include <crypto/internal/hash.h>
14
-#include <linux/cryptohash.h>
159 #include <linux/types.h>
1610 #include <linux/string.h>
1711 #include <crypto/sha.h>
....@@ -25,15 +19,21 @@
2519 MODULE_ALIAS_CRYPTO("sha384");
2620 MODULE_ALIAS_CRYPTO("sha512");
2721
28
-asmlinkage void sha512_block_data_order(u32 *digest, const void *data,
22
+asmlinkage void sha512_block_data_order(u64 *digest, const void *data,
2923 unsigned int num_blks);
3024 EXPORT_SYMBOL(sha512_block_data_order);
25
+
26
+static void __sha512_block_data_order(struct sha512_state *sst, u8 const *src,
27
+ int blocks)
28
+{
29
+ sha512_block_data_order(sst->state, src, blocks);
30
+}
3131
3232 static int sha512_update(struct shash_desc *desc, const u8 *data,
3333 unsigned int len)
3434 {
3535 return sha512_base_do_update(desc, data, len,
36
- (sha512_block_fn *)sha512_block_data_order);
36
+ __sha512_block_data_order);
3737 }
3838
3939 static int sha512_finup(struct shash_desc *desc, const u8 *data,
....@@ -41,9 +41,8 @@
4141 {
4242 if (len)
4343 sha512_base_do_update(desc, data, len,
44
- (sha512_block_fn *)sha512_block_data_order);
45
- sha512_base_do_finalize(desc,
46
- (sha512_block_fn *)sha512_block_data_order);
44
+ __sha512_block_data_order);
45
+ sha512_base_do_finalize(desc, __sha512_block_data_order);
4746
4847 return sha512_base_finish(desc, out);
4948 }