aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/crypto/serpent_sse2_glue.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/crypto/serpent_sse2_glue.c')
-rw-r--r--arch/x86/crypto/serpent_sse2_glue.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/arch/x86/crypto/serpent_sse2_glue.c b/arch/x86/crypto/serpent_sse2_glue.c
index 2f5c304653f4..7955a9b76b91 100644
--- a/arch/x86/crypto/serpent_sse2_glue.c
+++ b/arch/x86/crypto/serpent_sse2_glue.c
@@ -47,14 +47,6 @@
47#include <linux/workqueue.h> 47#include <linux/workqueue.h>
48#include <linux/spinlock.h> 48#include <linux/spinlock.h>
49 49
50#if defined(CONFIG_CRYPTO_LRW) || defined(CONFIG_CRYPTO_LRW_MODULE)
51#define HAS_LRW
52#endif
53
54#if defined(CONFIG_CRYPTO_XTS) || defined(CONFIG_CRYPTO_XTS_MODULE)
55#define HAS_XTS
56#endif
57
58struct async_serpent_ctx { 50struct async_serpent_ctx {
59 struct cryptd_ablkcipher *cryptd_tfm; 51 struct cryptd_ablkcipher *cryptd_tfm;
60}; 52};
@@ -470,8 +462,6 @@ static struct crypto_alg blk_ctr_alg = {
470 }, 462 },
471}; 463};
472 464
473#if defined(HAS_LRW) || defined(HAS_XTS)
474
475struct crypt_priv { 465struct crypt_priv {
476 struct serpent_ctx *ctx; 466 struct serpent_ctx *ctx;
477 bool fpu_enabled; 467 bool fpu_enabled;
@@ -511,10 +501,6 @@ static void decrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes)
511 __serpent_decrypt(ctx->ctx, srcdst, srcdst); 501 __serpent_decrypt(ctx->ctx, srcdst, srcdst);
512} 502}
513 503
514#endif
515
516#ifdef HAS_LRW
517
518struct serpent_lrw_ctx { 504struct serpent_lrw_ctx {
519 struct lrw_table_ctx lrw_table; 505 struct lrw_table_ctx lrw_table;
520 struct serpent_ctx serpent_ctx; 506 struct serpent_ctx serpent_ctx;
@@ -620,10 +606,6 @@ static struct crypto_alg blk_lrw_alg = {
620 }, 606 },
621}; 607};
622 608
623#endif
624
625#ifdef HAS_XTS
626
627struct serpent_xts_ctx { 609struct serpent_xts_ctx {
628 struct serpent_ctx tweak_ctx; 610 struct serpent_ctx tweak_ctx;
629 struct serpent_ctx crypt_ctx; 611 struct serpent_ctx crypt_ctx;
@@ -730,8 +712,6 @@ static struct crypto_alg blk_xts_alg = {
730 }, 712 },
731}; 713};
732 714
733#endif
734
735static int ablk_set_key(struct crypto_ablkcipher *tfm, const u8 *key, 715static int ablk_set_key(struct crypto_ablkcipher *tfm, const u8 *key,
736 unsigned int key_len) 716 unsigned int key_len)
737{ 717{
@@ -930,8 +910,6 @@ static struct crypto_alg ablk_ctr_alg = {
930 }, 910 },
931}; 911};
932 912
933#ifdef HAS_LRW
934
935static int ablk_lrw_init(struct crypto_tfm *tfm) 913static int ablk_lrw_init(struct crypto_tfm *tfm)
936{ 914{
937 struct cryptd_ablkcipher *cryptd_tfm; 915 struct cryptd_ablkcipher *cryptd_tfm;
@@ -970,10 +948,6 @@ static struct crypto_alg ablk_lrw_alg = {
970 }, 948 },
971}; 949};
972 950
973#endif
974
975#ifdef HAS_XTS
976
977static int ablk_xts_init(struct crypto_tfm *tfm) 951static int ablk_xts_init(struct crypto_tfm *tfm)
978{ 952{
979 struct cryptd_ablkcipher *cryptd_tfm; 953 struct cryptd_ablkcipher *cryptd_tfm;
@@ -1010,8 +984,6 @@ static struct crypto_alg ablk_xts_alg = {
1010 }, 984 },
1011}; 985};
1012 986
1013#endif
1014
1015static int __init serpent_sse2_init(void) 987static int __init serpent_sse2_init(void)
1016{ 988{
1017 int err; 989 int err;
@@ -1039,36 +1011,28 @@ static int __init serpent_sse2_init(void)
1039 err = crypto_register_alg(&ablk_ctr_alg); 1011 err = crypto_register_alg(&ablk_ctr_alg);
1040 if (err) 1012 if (err)
1041 goto ablk_ctr_err; 1013 goto ablk_ctr_err;
1042#ifdef HAS_LRW
1043 err = crypto_register_alg(&blk_lrw_alg); 1014 err = crypto_register_alg(&blk_lrw_alg);
1044 if (err) 1015 if (err)
1045 goto blk_lrw_err; 1016 goto blk_lrw_err;
1046 err = crypto_register_alg(&ablk_lrw_alg); 1017 err = crypto_register_alg(&ablk_lrw_alg);
1047 if (err) 1018 if (err)
1048 goto ablk_lrw_err; 1019 goto ablk_lrw_err;
1049#endif
1050#ifdef HAS_XTS
1051 err = crypto_register_alg(&blk_xts_alg); 1020 err = crypto_register_alg(&blk_xts_alg);
1052 if (err) 1021 if (err)
1053 goto blk_xts_err; 1022 goto blk_xts_err;
1054 err = crypto_register_alg(&ablk_xts_alg); 1023 err = crypto_register_alg(&ablk_xts_alg);
1055 if (err) 1024 if (err)
1056 goto ablk_xts_err; 1025 goto ablk_xts_err;
1057#endif
1058 return err; 1026 return err;
1059 1027
1060#ifdef HAS_XTS
1061 crypto_unregister_alg(&ablk_xts_alg); 1028 crypto_unregister_alg(&ablk_xts_alg);
1062ablk_xts_err: 1029ablk_xts_err:
1063 crypto_unregister_alg(&blk_xts_alg); 1030 crypto_unregister_alg(&blk_xts_alg);
1064blk_xts_err: 1031blk_xts_err:
1065#endif
1066#ifdef HAS_LRW
1067 crypto_unregister_alg(&ablk_lrw_alg); 1032 crypto_unregister_alg(&ablk_lrw_alg);
1068ablk_lrw_err: 1033ablk_lrw_err:
1069 crypto_unregister_alg(&blk_lrw_alg); 1034 crypto_unregister_alg(&blk_lrw_alg);
1070blk_lrw_err: 1035blk_lrw_err:
1071#endif
1072 crypto_unregister_alg(&ablk_ctr_alg); 1036 crypto_unregister_alg(&ablk_ctr_alg);
1073ablk_ctr_err: 1037ablk_ctr_err:
1074 crypto_unregister_alg(&ablk_cbc_alg); 1038 crypto_unregister_alg(&ablk_cbc_alg);
@@ -1086,14 +1050,10 @@ blk_ecb_err:
1086 1050
1087static void __exit serpent_sse2_exit(void) 1051static void __exit serpent_sse2_exit(void)
1088{ 1052{
1089#ifdef HAS_XTS
1090 crypto_unregister_alg(&ablk_xts_alg); 1053 crypto_unregister_alg(&ablk_xts_alg);
1091 crypto_unregister_alg(&blk_xts_alg); 1054 crypto_unregister_alg(&blk_xts_alg);
1092#endif
1093#ifdef HAS_LRW
1094 crypto_unregister_alg(&ablk_lrw_alg); 1055 crypto_unregister_alg(&ablk_lrw_alg);
1095 crypto_unregister_alg(&blk_lrw_alg); 1056 crypto_unregister_alg(&blk_lrw_alg);
1096#endif
1097 crypto_unregister_alg(&ablk_ctr_alg); 1057 crypto_unregister_alg(&ablk_ctr_alg);
1098 crypto_unregister_alg(&ablk_cbc_alg); 1058 crypto_unregister_alg(&ablk_cbc_alg);
1099 crypto_unregister_alg(&ablk_ecb_alg); 1059 crypto_unregister_alg(&ablk_ecb_alg);