diff options
| -rw-r--r-- | arch/x86/crypto/twofish_glue_3way.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/arch/x86/crypto/twofish_glue_3way.c b/arch/x86/crypto/twofish_glue_3way.c index 954f59eeb7b4..7fee8c152f93 100644 --- a/arch/x86/crypto/twofish_glue_3way.c +++ b/arch/x86/crypto/twofish_glue_3way.c | |||
| @@ -35,14 +35,6 @@ | |||
| 35 | #include <crypto/lrw.h> | 35 | #include <crypto/lrw.h> |
| 36 | #include <crypto/xts.h> | 36 | #include <crypto/xts.h> |
| 37 | 37 | ||
| 38 | #if defined(CONFIG_CRYPTO_LRW) || defined(CONFIG_CRYPTO_LRW_MODULE) | ||
| 39 | #define HAS_LRW | ||
| 40 | #endif | ||
| 41 | |||
| 42 | #if defined(CONFIG_CRYPTO_XTS) || defined(CONFIG_CRYPTO_XTS_MODULE) | ||
| 43 | #define HAS_XTS | ||
| 44 | #endif | ||
| 45 | |||
| 46 | /* regular block cipher functions from twofish_x86_64 module */ | 38 | /* regular block cipher functions from twofish_x86_64 module */ |
| 47 | asmlinkage void twofish_enc_blk(struct twofish_ctx *ctx, u8 *dst, | 39 | asmlinkage void twofish_enc_blk(struct twofish_ctx *ctx, u8 *dst, |
| 48 | const u8 *src); | 40 | const u8 *src); |
| @@ -442,8 +434,6 @@ static struct crypto_alg blk_ctr_alg = { | |||
| 442 | }, | 434 | }, |
| 443 | }; | 435 | }; |
| 444 | 436 | ||
| 445 | #if defined(HAS_LRW) || defined(HAS_XTS) | ||
| 446 | |||
| 447 | static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) | 437 | static void encrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) |
| 448 | { | 438 | { |
| 449 | const unsigned int bsize = TF_BLOCK_SIZE; | 439 | const unsigned int bsize = TF_BLOCK_SIZE; |
| @@ -474,10 +464,6 @@ static void decrypt_callback(void *priv, u8 *srcdst, unsigned int nbytes) | |||
| 474 | twofish_dec_blk(ctx, srcdst, srcdst); | 464 | twofish_dec_blk(ctx, srcdst, srcdst); |
| 475 | } | 465 | } |
| 476 | 466 | ||
| 477 | #endif | ||
| 478 | |||
| 479 | #ifdef HAS_LRW | ||
| 480 | |||
| 481 | struct twofish_lrw_ctx { | 467 | struct twofish_lrw_ctx { |
| 482 | struct lrw_table_ctx lrw_table; | 468 | struct lrw_table_ctx lrw_table; |
| 483 | struct twofish_ctx twofish_ctx; | 469 | struct twofish_ctx twofish_ctx; |
| @@ -562,10 +548,6 @@ static struct crypto_alg blk_lrw_alg = { | |||
| 562 | }, | 548 | }, |
| 563 | }; | 549 | }; |
| 564 | 550 | ||
| 565 | #endif | ||
| 566 | |||
| 567 | #ifdef HAS_XTS | ||
| 568 | |||
| 569 | struct twofish_xts_ctx { | 551 | struct twofish_xts_ctx { |
| 570 | struct twofish_ctx tweak_ctx; | 552 | struct twofish_ctx tweak_ctx; |
| 571 | struct twofish_ctx crypt_ctx; | 553 | struct twofish_ctx crypt_ctx; |
| @@ -655,8 +637,6 @@ static struct crypto_alg blk_xts_alg = { | |||
| 655 | }, | 637 | }, |
| 656 | }; | 638 | }; |
| 657 | 639 | ||
| 658 | #endif | ||
| 659 | |||
| 660 | int __init init(void) | 640 | int __init init(void) |
| 661 | { | 641 | { |
| 662 | int err; | 642 | int err; |
| @@ -670,27 +650,19 @@ int __init init(void) | |||
| 670 | err = crypto_register_alg(&blk_ctr_alg); | 650 | err = crypto_register_alg(&blk_ctr_alg); |
| 671 | if (err) | 651 | if (err) |
| 672 | goto ctr_err; | 652 | goto ctr_err; |
| 673 | #ifdef HAS_LRW | ||
| 674 | err = crypto_register_alg(&blk_lrw_alg); | 653 | err = crypto_register_alg(&blk_lrw_alg); |
| 675 | if (err) | 654 | if (err) |
| 676 | goto blk_lrw_err; | 655 | goto blk_lrw_err; |
| 677 | #endif | ||
| 678 | #ifdef HAS_XTS | ||
| 679 | err = crypto_register_alg(&blk_xts_alg); | 656 | err = crypto_register_alg(&blk_xts_alg); |
| 680 | if (err) | 657 | if (err) |
| 681 | goto blk_xts_err; | 658 | goto blk_xts_err; |
| 682 | #endif | ||
| 683 | 659 | ||
| 684 | return 0; | 660 | return 0; |
| 685 | 661 | ||
| 686 | #ifdef HAS_XTS | ||
| 687 | crypto_unregister_alg(&blk_xts_alg); | 662 | crypto_unregister_alg(&blk_xts_alg); |
| 688 | blk_xts_err: | 663 | blk_xts_err: |
| 689 | #endif | ||
| 690 | #ifdef HAS_LRW | ||
| 691 | crypto_unregister_alg(&blk_lrw_alg); | 664 | crypto_unregister_alg(&blk_lrw_alg); |
| 692 | blk_lrw_err: | 665 | blk_lrw_err: |
| 693 | #endif | ||
| 694 | crypto_unregister_alg(&blk_ctr_alg); | 666 | crypto_unregister_alg(&blk_ctr_alg); |
| 695 | ctr_err: | 667 | ctr_err: |
| 696 | crypto_unregister_alg(&blk_cbc_alg); | 668 | crypto_unregister_alg(&blk_cbc_alg); |
| @@ -702,12 +674,8 @@ ecb_err: | |||
| 702 | 674 | ||
| 703 | void __exit fini(void) | 675 | void __exit fini(void) |
| 704 | { | 676 | { |
| 705 | #ifdef HAS_XTS | ||
| 706 | crypto_unregister_alg(&blk_xts_alg); | 677 | crypto_unregister_alg(&blk_xts_alg); |
| 707 | #endif | ||
| 708 | #ifdef HAS_LRW | ||
| 709 | crypto_unregister_alg(&blk_lrw_alg); | 678 | crypto_unregister_alg(&blk_lrw_alg); |
| 710 | #endif | ||
| 711 | crypto_unregister_alg(&blk_ctr_alg); | 679 | crypto_unregister_alg(&blk_ctr_alg); |
| 712 | crypto_unregister_alg(&blk_cbc_alg); | 680 | crypto_unregister_alg(&blk_cbc_alg); |
| 713 | crypto_unregister_alg(&blk_ecb_alg); | 681 | crypto_unregister_alg(&blk_ecb_alg); |
