| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * sha1-ce-glue.c - SHA-1 secure hash using ARMv8 Crypto Extensions |
|---|
| 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/sha1_base.h> |
|---|
| 14 | 12 | #include <linux/cpufeature.h> |
|---|
| .. | .. |
|---|
| 33 | 31 | { |
|---|
| 34 | 32 | struct sha1_state *sctx = shash_desc_ctx(desc); |
|---|
| 35 | 33 | |
|---|
| 36 | | - if (!may_use_simd() || |
|---|
| 34 | + if (!crypto_simd_usable() || |
|---|
| 37 | 35 | (sctx->count % SHA1_BLOCK_SIZE) + len < SHA1_BLOCK_SIZE) |
|---|
| 38 | 36 | return sha1_update_arm(desc, data, len); |
|---|
| 39 | 37 | |
|---|
| .. | .. |
|---|
| 47 | 45 | static int sha1_ce_finup(struct shash_desc *desc, const u8 *data, |
|---|
| 48 | 46 | unsigned int len, u8 *out) |
|---|
| 49 | 47 | { |
|---|
| 50 | | - if (!may_use_simd()) |
|---|
| 48 | + if (!crypto_simd_usable()) |
|---|
| 51 | 49 | return sha1_finup_arm(desc, data, len, out); |
|---|
| 52 | 50 | |
|---|
| 53 | 51 | kernel_neon_begin(); |
|---|