| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Linux/arm64 port of the OpenSSL SHA512 implementation for AArch64 |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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 | | - * |
|---|
| 11 | 6 | */ |
|---|
| 12 | 7 | |
|---|
| 13 | 8 | #include <crypto/internal/hash.h> |
|---|
| 14 | | -#include <linux/cryptohash.h> |
|---|
| 15 | 9 | #include <linux/types.h> |
|---|
| 16 | 10 | #include <linux/string.h> |
|---|
| 17 | 11 | #include <crypto/sha.h> |
|---|
| .. | .. |
|---|
| 25 | 19 | MODULE_ALIAS_CRYPTO("sha384"); |
|---|
| 26 | 20 | MODULE_ALIAS_CRYPTO("sha512"); |
|---|
| 27 | 21 | |
|---|
| 28 | | -asmlinkage void sha512_block_data_order(u32 *digest, const void *data, |
|---|
| 22 | +asmlinkage void sha512_block_data_order(u64 *digest, const void *data, |
|---|
| 29 | 23 | unsigned int num_blks); |
|---|
| 30 | 24 | 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 | +} |
|---|
| 31 | 31 | |
|---|
| 32 | 32 | static int sha512_update(struct shash_desc *desc, const u8 *data, |
|---|
| 33 | 33 | unsigned int len) |
|---|
| 34 | 34 | { |
|---|
| 35 | 35 | return sha512_base_do_update(desc, data, len, |
|---|
| 36 | | - (sha512_block_fn *)sha512_block_data_order); |
|---|
| 36 | + __sha512_block_data_order); |
|---|
| 37 | 37 | } |
|---|
| 38 | 38 | |
|---|
| 39 | 39 | static int sha512_finup(struct shash_desc *desc, const u8 *data, |
|---|
| .. | .. |
|---|
| 41 | 41 | { |
|---|
| 42 | 42 | if (len) |
|---|
| 43 | 43 | 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); |
|---|
| 47 | 46 | |
|---|
| 48 | 47 | return sha512_base_finish(desc, out); |
|---|
| 49 | 48 | } |
|---|