.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * Glue code for the SHA1 Secure Hash Algorithm assembler implementation using |
---|
3 | 4 | * ARM NEON instructions. |
---|
.. | .. |
---|
10 | 11 | * Copyright (c) Jean-Francois Dive <jef@linuxbe.org> |
---|
11 | 12 | * Copyright (c) Mathias Krause <minipli@googlemail.com> |
---|
12 | 13 | * 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 | | - * |
---|
19 | 14 | */ |
---|
20 | 15 | |
---|
21 | 16 | #include <crypto/internal/hash.h> |
---|
| 17 | +#include <crypto/internal/simd.h> |
---|
22 | 18 | #include <linux/init.h> |
---|
23 | 19 | #include <linux/module.h> |
---|
24 | 20 | #include <linux/mm.h> |
---|
25 | | -#include <linux/cryptohash.h> |
---|
26 | 21 | #include <linux/types.h> |
---|
27 | 22 | #include <crypto/sha.h> |
---|
28 | 23 | #include <crypto/sha1_base.h> |
---|
.. | .. |
---|
39 | 34 | { |
---|
40 | 35 | struct sha1_state *sctx = shash_desc_ctx(desc); |
---|
41 | 36 | |
---|
42 | | - if (!may_use_simd() || |
---|
| 37 | + if (!crypto_simd_usable() || |
---|
43 | 38 | (sctx->count % SHA1_BLOCK_SIZE) + len < SHA1_BLOCK_SIZE) |
---|
44 | 39 | return sha1_update_arm(desc, data, len); |
---|
45 | 40 | |
---|
.. | .. |
---|
54 | 49 | static int sha1_neon_finup(struct shash_desc *desc, const u8 *data, |
---|
55 | 50 | unsigned int len, u8 *out) |
---|
56 | 51 | { |
---|
57 | | - if (!may_use_simd()) |
---|
| 52 | + if (!crypto_simd_usable()) |
---|
58 | 53 | return sha1_finup_arm(desc, data, len, out); |
---|
59 | 54 | |
---|
60 | 55 | kernel_neon_begin(); |
---|