summaryrefslogtreecommitdiff
path: root/arch/arm64/crypto/sha3-ce-glue.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2019-03-12 22:12:50 -0700
committerHerbert Xu <herbert@gondor.apana.org.au>2019-03-22 20:57:27 +0800
commite52b7023cdad005756cd91d7c54fa90ef6b43d32 (patch)
treeb2aae39c8c5acfe29a6e95f27fc2539ad2efc547 /arch/arm64/crypto/sha3-ce-glue.c
parent99680c5e91829453e001ab5f7e6d717e6d2dcb21 (diff)
crypto: arm64 - convert to use crypto_simd_usable()
Replace all calls to may_use_simd() in the arm64 crypto code with crypto_simd_usable(), in order to allow testing the no-SIMD code paths. Signed-off-by: Eric Biggers <ebiggers@google.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'arch/arm64/crypto/sha3-ce-glue.c')
-rw-r--r--arch/arm64/crypto/sha3-ce-glue.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/arm64/crypto/sha3-ce-glue.c b/arch/arm64/crypto/sha3-ce-glue.c
index a336feac0f59..9a4bbfc45f40 100644
--- a/arch/arm64/crypto/sha3-ce-glue.c
+++ b/arch/arm64/crypto/sha3-ce-glue.c
@@ -14,6 +14,7 @@
#include <asm/simd.h>
#include <asm/unaligned.h>
#include <crypto/internal/hash.h>
+#include <crypto/internal/simd.h>
#include <crypto/sha3.h>
#include <linux/cpufeature.h>
#include <linux/crypto.h>
@@ -32,7 +33,7 @@ static int sha3_update(struct shash_desc *desc, const u8 *data,
struct sha3_state *sctx = shash_desc_ctx(desc);
unsigned int digest_size = crypto_shash_digestsize(desc->tfm);
- if (!may_use_simd())
+ if (!crypto_simd_usable())
return crypto_sha3_update(desc, data, len);
if ((sctx->partial + len) >= sctx->rsiz) {
@@ -76,7 +77,7 @@ static int sha3_final(struct shash_desc *desc, u8 *out)
__le64 *digest = (__le64 *)out;
int i;
- if (!may_use_simd())
+ if (!crypto_simd_usable())
return crypto_sha3_final(desc, out);
sctx->buf[sctx->partial++] = 0x06;