Commit 8b8d91d4 authored by Eric Biggers's avatar Eric Biggers Committed by Herbert Xu

crypto: simd - convert to use crypto_simd_usable()

Replace all calls to may_use_simd() in the shared SIMD helpers with
crypto_simd_usable(), in order to allow testing the no-SIMD code paths.
Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
Reviewed-by: default avatarArd Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent e52b7023
...@@ -85,7 +85,7 @@ static int simd_skcipher_encrypt(struct skcipher_request *req) ...@@ -85,7 +85,7 @@ static int simd_skcipher_encrypt(struct skcipher_request *req)
subreq = skcipher_request_ctx(req); subreq = skcipher_request_ctx(req);
*subreq = *req; *subreq = *req;
if (!may_use_simd() || if (!crypto_simd_usable() ||
(in_atomic() && cryptd_skcipher_queued(ctx->cryptd_tfm))) (in_atomic() && cryptd_skcipher_queued(ctx->cryptd_tfm)))
child = &ctx->cryptd_tfm->base; child = &ctx->cryptd_tfm->base;
else else
...@@ -106,7 +106,7 @@ static int simd_skcipher_decrypt(struct skcipher_request *req) ...@@ -106,7 +106,7 @@ static int simd_skcipher_decrypt(struct skcipher_request *req)
subreq = skcipher_request_ctx(req); subreq = skcipher_request_ctx(req);
*subreq = *req; *subreq = *req;
if (!may_use_simd() || if (!crypto_simd_usable() ||
(in_atomic() && cryptd_skcipher_queued(ctx->cryptd_tfm))) (in_atomic() && cryptd_skcipher_queued(ctx->cryptd_tfm)))
child = &ctx->cryptd_tfm->base; child = &ctx->cryptd_tfm->base;
else else
...@@ -336,7 +336,7 @@ static int simd_aead_encrypt(struct aead_request *req) ...@@ -336,7 +336,7 @@ static int simd_aead_encrypt(struct aead_request *req)
subreq = aead_request_ctx(req); subreq = aead_request_ctx(req);
*subreq = *req; *subreq = *req;
if (!may_use_simd() || if (!crypto_simd_usable() ||
(in_atomic() && cryptd_aead_queued(ctx->cryptd_tfm))) (in_atomic() && cryptd_aead_queued(ctx->cryptd_tfm)))
child = &ctx->cryptd_tfm->base; child = &ctx->cryptd_tfm->base;
else else
...@@ -357,7 +357,7 @@ static int simd_aead_decrypt(struct aead_request *req) ...@@ -357,7 +357,7 @@ static int simd_aead_decrypt(struct aead_request *req)
subreq = aead_request_ctx(req); subreq = aead_request_ctx(req);
*subreq = *req; *subreq = *req;
if (!may_use_simd() || if (!crypto_simd_usable() ||
(in_atomic() && cryptd_aead_queued(ctx->cryptd_tfm))) (in_atomic() && cryptd_aead_queued(ctx->cryptd_tfm)))
child = &ctx->cryptd_tfm->base; child = &ctx->cryptd_tfm->base;
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment