.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * sha512-neon-glue.c - accelerated SHA-384/512 for ARM NEON |
---|
3 | 4 | * |
---|
4 | 5 | * 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. |
---|
9 | 6 | */ |
---|
10 | 7 | |
---|
11 | 8 | #include <crypto/internal/hash.h> |
---|
| 9 | +#include <crypto/internal/simd.h> |
---|
12 | 10 | #include <crypto/sha.h> |
---|
13 | 11 | #include <crypto/sha512_base.h> |
---|
14 | 12 | #include <linux/crypto.h> |
---|
.. | .. |
---|
30 | 28 | { |
---|
31 | 29 | struct sha512_state *sctx = shash_desc_ctx(desc); |
---|
32 | 30 | |
---|
33 | | - if (!may_use_simd() || |
---|
| 31 | + if (!crypto_simd_usable() || |
---|
34 | 32 | (sctx->count[0] % SHA512_BLOCK_SIZE) + len < SHA512_BLOCK_SIZE) |
---|
35 | 33 | return sha512_arm_update(desc, data, len); |
---|
36 | 34 | |
---|
.. | .. |
---|
45 | 43 | static int sha512_neon_finup(struct shash_desc *desc, const u8 *data, |
---|
46 | 44 | unsigned int len, u8 *out) |
---|
47 | 45 | { |
---|
48 | | - if (!may_use_simd()) |
---|
| 46 | + if (!crypto_simd_usable()) |
---|
49 | 47 | return sha512_arm_finup(desc, data, len, out); |
---|
50 | 48 | |
---|
51 | 49 | kernel_neon_begin(); |
---|