aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/aegis128.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2019-08-02 13:31:35 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2019-08-02 13:31:35 +1000
commitc9f1fd4f2f74f322d5bdc4ec2c6a38ab7462967b (patch)
tree18594b90724bdc94e06b81a1ef0a527c013a1a4e /crypto/aegis128.c
parentasm-generic: make simd.h a mandatory include/asm header (diff)
downloadlinux-dev-c9f1fd4f2f74f322d5bdc4ec2c6a38ab7462967b.tar.xz
linux-dev-c9f1fd4f2f74f322d5bdc4ec2c6a38ab7462967b.zip
Revert "crypto: aegis128 - add support for SIMD acceleration"
This reverts commit ecc8bc81f2fb3976737ef312f824ba6053aa3590 ("crypto: aegis128 - provide a SIMD implementation based on NEON intrinsics") and commit 7cdc0ddbf74a19cecb2f0e9efa2cae9d3c665189 ("crypto: aegis128 - add support for SIMD acceleration"). They cause compile errors on platforms other than ARM because the mechanism to selectively compile the SIMD code is broken. Repoted-by: Heiko Carstens <heiko.carstens@de.ibm.com> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--crypto/aegis128.c (renamed from crypto/aegis128-core.c)42
1 files changed, 4 insertions, 38 deletions
diff --git a/crypto/aegis128-core.c b/crypto/aegis128.c
index f815b4685156..32840d5e7f65 100644
--- a/crypto/aegis128-core.c
+++ b/crypto/aegis128.c
@@ -8,7 +8,6 @@
#include <crypto/algapi.h>
#include <crypto/internal/aead.h>
-#include <crypto/internal/simd.h>
#include <crypto/internal/skcipher.h>
#include <crypto/scatterwalk.h>
#include <linux/err.h>
@@ -16,7 +15,6 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/scatterlist.h>
-#include <asm/simd.h>
#include "aegis.h"
@@ -42,15 +40,6 @@ struct aegis128_ops {
const u8 *src, unsigned int size);
};
-static bool have_simd;
-
-bool crypto_aegis128_have_simd(void);
-void crypto_aegis128_update_simd(struct aegis_state *state, const void *msg);
-void crypto_aegis128_encrypt_chunk_simd(struct aegis_state *state, u8 *dst,
- const u8 *src, unsigned int size);
-void crypto_aegis128_decrypt_chunk_simd(struct aegis_state *state, u8 *dst,
- const u8 *src, unsigned int size);
-
static void crypto_aegis128_update(struct aegis_state *state)
{
union aegis_block tmp;
@@ -66,22 +55,12 @@ static void crypto_aegis128_update(struct aegis_state *state)
static void crypto_aegis128_update_a(struct aegis_state *state,
const union aegis_block *msg)
{
- if (have_simd && crypto_simd_usable()) {
- crypto_aegis128_update_simd(state, msg);
- return;
- }
-
crypto_aegis128_update(state);
crypto_aegis_block_xor(&state->blocks[0], msg);
}
static void crypto_aegis128_update_u(struct aegis_state *state, const void *msg)
{
- if (have_simd && crypto_simd_usable()) {
- crypto_aegis128_update_simd(state, msg);
- return;
- }
-
crypto_aegis128_update(state);
crypto_xor(state->blocks[0].bytes, msg, AEGIS_BLOCK_SIZE);
}
@@ -386,7 +365,7 @@ static void crypto_aegis128_crypt(struct aead_request *req,
static int crypto_aegis128_encrypt(struct aead_request *req)
{
- const struct aegis128_ops *ops = &(struct aegis128_ops){
+ static const struct aegis128_ops ops = {
.skcipher_walk_init = skcipher_walk_aead_encrypt,
.crypt_chunk = crypto_aegis128_encrypt_chunk,
};
@@ -396,12 +375,7 @@ static int crypto_aegis128_encrypt(struct aead_request *req)
unsigned int authsize = crypto_aead_authsize(tfm);
unsigned int cryptlen = req->cryptlen;
- if (have_simd && crypto_simd_usable())
- ops = &(struct aegis128_ops){
- .skcipher_walk_init = skcipher_walk_aead_encrypt,
- .crypt_chunk = crypto_aegis128_encrypt_chunk_simd };
-
- crypto_aegis128_crypt(req, &tag, cryptlen, ops);
+ crypto_aegis128_crypt(req, &tag, cryptlen, &ops);
scatterwalk_map_and_copy(tag.bytes, req->dst, req->assoclen + cryptlen,
authsize, 1);
@@ -410,7 +384,7 @@ static int crypto_aegis128_encrypt(struct aead_request *req)
static int crypto_aegis128_decrypt(struct aead_request *req)
{
- const struct aegis128_ops *ops = &(struct aegis128_ops){
+ static const struct aegis128_ops ops = {
.skcipher_walk_init = skcipher_walk_aead_decrypt,
.crypt_chunk = crypto_aegis128_decrypt_chunk,
};
@@ -424,12 +398,7 @@ static int crypto_aegis128_decrypt(struct aead_request *req)
scatterwalk_map_and_copy(tag.bytes, req->src, req->assoclen + cryptlen,
authsize, 0);
- if (have_simd && crypto_simd_usable())
- ops = &(struct aegis128_ops){
- .skcipher_walk_init = skcipher_walk_aead_decrypt,
- .crypt_chunk = crypto_aegis128_decrypt_chunk_simd };
-
- crypto_aegis128_crypt(req, &tag, cryptlen, ops);
+ crypto_aegis128_crypt(req, &tag, cryptlen, &ops);
return crypto_memneq(tag.bytes, zeros, authsize) ? -EBADMSG : 0;
}
@@ -460,9 +429,6 @@ static struct aead_alg crypto_aegis128_alg = {
static int __init crypto_aegis128_module_init(void)
{
- if (IS_ENABLED(CONFIG_CRYPTO_AEGIS128_SIMD))
- have_simd = crypto_aegis128_have_simd();
-
return crypto_register_aead(&crypto_aegis128_alg);
}