crypto: twofish-x86_64-3way - remove unneeded LRW/XTS #ifdefs
Since LRW & XTS are selected by twofish-x86_64-3way, we don't need these #ifdefs anymore. Signed-off-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
committed by
Herbert Xu
parent
e7cda5d27e
commit
88715b9ade
@@ -35,14 +35,6 @@
|
|||||||
#include <crypto/lrw.h>
|
#include <crypto/lrw.h>
|
||||||
#include <crypto/xts.h>
|
#include <crypto/xts.h>
|
||||||
|
|
||||||
#if defined(CONFIG_CRYPTO_LRW) || defined(CONFIG_CRYPTO_LRW_MODULE)
|
|
||||||
#define HAS_LRW
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CONFIG_CRYPTO_XTS) || defined(CONFIG_CRYPTO_XTS_MODULE)
|
|
||||||
#define HAS_XTS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* regular block cipher functions from twofish_x86_64 module */
|
/* regular block cipher functions from twofish_x86_64 module */
|
||||||
asmlinkage void twofish_enc_blk(struct twofish_ctx *ctx, u8 *dst,
|
asmlinkage void twofish_enc_blk(struct twofish_ctx *ctx, u8 *dst,
|
||||||
const u8 *src);
|
const u8 *src);
|
||||||
@@ -442,8 +434,6 @@ static struct crypto_alg blk_ctr_alg = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(HAS_LRW) || defined(HAS_XTS)
|
|
||||||
|
|
||||||
static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes)
|
static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes)
|
||||||
{
|
{
|
||||||
const unsigned int bsize = TF_BLOCK_SIZE;
|
const unsigned int bsize = TF_BLOCK_SIZE;
|
||||||
@@ -474,10 +464,6 @@ static void decrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes)
|
|||||||
twofish_dec_blk(ctx, srcdst, srcdst);
|
twofish_dec_blk(ctx, srcdst, srcdst);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAS_LRW
|
|
||||||
|
|
||||||
struct twofish_lrw_ctx {
|
struct twofish_lrw_ctx {
|
||||||
struct lrw_table_ctx lrw_table;
|
struct lrw_table_ctx lrw_table;
|
||||||
struct twofish_ctx twofish_ctx;
|
struct twofish_ctx twofish_ctx;
|
||||||
@@ -562,10 +548,6 @@ static struct crypto_alg blk_lrw_alg = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAS_XTS
|
|
||||||
|
|
||||||
struct twofish_xts_ctx {
|
struct twofish_xts_ctx {
|
||||||
struct twofish_ctx tweak_ctx;
|
struct twofish_ctx tweak_ctx;
|
||||||
struct twofish_ctx crypt_ctx;
|
struct twofish_ctx crypt_ctx;
|
||||||
@@ -655,8 +637,6 @@ static struct crypto_alg blk_xts_alg = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int __init init(void)
|
int __init init(void)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
@@ -670,27 +650,19 @@ int __init init(void)
|
|||||||
err = crypto_register_alg(&blk_ctr_alg);
|
err = crypto_register_alg(&blk_ctr_alg);
|
||||||
if (err)
|
if (err)
|
||||||
goto ctr_err;
|
goto ctr_err;
|
||||||
#ifdef HAS_LRW
|
|
||||||
err = crypto_register_alg(&blk_lrw_alg);
|
err = crypto_register_alg(&blk_lrw_alg);
|
||||||
if (err)
|
if (err)
|
||||||
goto blk_lrw_err;
|
goto blk_lrw_err;
|
||||||
#endif
|
|
||||||
#ifdef HAS_XTS
|
|
||||||
err = crypto_register_alg(&blk_xts_alg);
|
err = crypto_register_alg(&blk_xts_alg);
|
||||||
if (err)
|
if (err)
|
||||||
goto blk_xts_err;
|
goto blk_xts_err;
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#ifdef HAS_XTS
|
|
||||||
crypto_unregister_alg(&blk_xts_alg);
|
crypto_unregister_alg(&blk_xts_alg);
|
||||||
blk_xts_err:
|
blk_xts_err:
|
||||||
#endif
|
|
||||||
#ifdef HAS_LRW
|
|
||||||
crypto_unregister_alg(&blk_lrw_alg);
|
crypto_unregister_alg(&blk_lrw_alg);
|
||||||
blk_lrw_err:
|
blk_lrw_err:
|
||||||
#endif
|
|
||||||
crypto_unregister_alg(&blk_ctr_alg);
|
crypto_unregister_alg(&blk_ctr_alg);
|
||||||
ctr_err:
|
ctr_err:
|
||||||
crypto_unregister_alg(&blk_cbc_alg);
|
crypto_unregister_alg(&blk_cbc_alg);
|
||||||
@@ -702,12 +674,8 @@ ecb_err:
|
|||||||
|
|
||||||
void __exit fini(void)
|
void __exit fini(void)
|
||||||
{
|
{
|
||||||
#ifdef HAS_XTS
|
|
||||||
crypto_unregister_alg(&blk_xts_alg);
|
crypto_unregister_alg(&blk_xts_alg);
|
||||||
#endif
|
|
||||||
#ifdef HAS_LRW
|
|
||||||
crypto_unregister_alg(&blk_lrw_alg);
|
crypto_unregister_alg(&blk_lrw_alg);
|
||||||
#endif
|
|
||||||
crypto_unregister_alg(&blk_ctr_alg);
|
crypto_unregister_alg(&blk_ctr_alg);
|
||||||
crypto_unregister_alg(&blk_cbc_alg);
|
crypto_unregister_alg(&blk_cbc_alg);
|
||||||
crypto_unregister_alg(&blk_ecb_alg);
|
crypto_unregister_alg(&blk_ecb_alg);
|
||||||
|
Reference in New Issue
Block a user