[PATCH 1/3] crypto: x86/twofish-3way - Remove unused encode parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



__twofish_enc_blk_3way() takes a third parameter which is always
hardcoded to false. Remove it to simplify twofish_enc_blk_3way.

There are also callers in other x86 crypto modules. Modify those to
call the assembly function directly.

Signed-off-by: Peter Lafreniere <peter@xxxxxxxx>
---
 arch/x86/crypto/twofish-x86_64-asm_64-3way.S | 18 ++----------------
 arch/x86/crypto/twofish.h                    |  3 +--
 arch/x86/crypto/twofish_avx_glue.c           |  5 -----
 arch/x86/crypto/twofish_glue_3way.c          |  7 +------
 4 files changed, 4 insertions(+), 29 deletions(-)

diff --git a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S
index d2288bf38a8a..fa11513dbbf1 100644
--- a/arch/x86/crypto/twofish-x86_64-asm_64-3way.S
+++ b/arch/x86/crypto/twofish-x86_64-asm_64-3way.S
@@ -220,18 +220,16 @@
 	rorq $32,			RAB2; \
 	outunpack3(mov, RIO, 2, RAB, 2);
 
-SYM_FUNC_START(__twofish_enc_blk_3way)
+SYM_FUNC_START(twofish_enc_blk_3way)
 	/* input:
 	 *	%rdi: ctx, CTX
 	 *	%rsi: dst
 	 *	%rdx: src, RIO
-	 *	%rcx: bool, if true: xor output
 	 */
 	pushq %r13;
 	pushq %r12;
 	pushq %rbx;
 
-	pushq %rcx; /* bool xor */
 	pushq %rsi; /* dst */
 
 	inpack_enc3();
@@ -248,10 +246,6 @@ SYM_FUNC_START(__twofish_enc_blk_3way)
 	pop_cd();
 
 	popq RIO; /* dst */
-	popq RT1; /* bool xor */
-
-	testb RT1bl, RT1bl;
-	jnz .L__enc_xor3;
 
 	outunpack_enc3(mov);
 
@@ -259,15 +253,7 @@ SYM_FUNC_START(__twofish_enc_blk_3way)
 	popq %r12;
 	popq %r13;
 	RET;
-
-.L__enc_xor3:
-	outunpack_enc3(xor);
-
-	popq %rbx;
-	popq %r12;
-	popq %r13;
-	RET;
-SYM_FUNC_END(__twofish_enc_blk_3way)
+SYM_FUNC_END(twofish_enc_blk_3way)
 
 SYM_FUNC_START(twofish_dec_blk_3way)
 	/* input:
diff --git a/arch/x86/crypto/twofish.h b/arch/x86/crypto/twofish.h
index 12df400e6d53..feb0a6f820a6 100644
--- a/arch/x86/crypto/twofish.h
+++ b/arch/x86/crypto/twofish.h
@@ -11,8 +11,7 @@ asmlinkage void twofish_enc_blk(const void *ctx, u8 *dst, const u8 *src);
 asmlinkage void twofish_dec_blk(const void *ctx, u8 *dst, const u8 *src);
 
 /* 3-way parallel cipher functions */
-asmlinkage void __twofish_enc_blk_3way(const void *ctx, u8 *dst, const u8 *src,
-				       bool xor);
+asmlinkage void twofish_enc_blk_3way(const void *ctx, u8 *dst, const u8 *src);
 asmlinkage void twofish_dec_blk_3way(const void *ctx, u8 *dst, const u8 *src);
 
 /* helpers from twofish_x86_64-3way module */
diff --git a/arch/x86/crypto/twofish_avx_glue.c b/arch/x86/crypto/twofish_avx_glue.c
index 3eb3440b477a..257a79f4cb58 100644
--- a/arch/x86/crypto/twofish_avx_glue.c
+++ b/arch/x86/crypto/twofish_avx_glue.c
@@ -33,11 +33,6 @@ static int twofish_setkey_skcipher(struct crypto_skcipher *tfm,
 	return twofish_setkey(&tfm->base, key, keylen);
 }
 
-static inline void twofish_enc_blk_3way(const void *ctx, u8 *dst, const u8 *src)
-{
-	__twofish_enc_blk_3way(ctx, dst, src, false);
-}
-
 static int ecb_encrypt(struct skcipher_request *req)
 {
 	ECB_WALK_START(req, TF_BLOCK_SIZE, TWOFISH_PARALLEL_BLOCKS);
diff --git a/arch/x86/crypto/twofish_glue_3way.c b/arch/x86/crypto/twofish_glue_3way.c
index 90454cf18e0d..c331c4ca9363 100644
--- a/arch/x86/crypto/twofish_glue_3way.c
+++ b/arch/x86/crypto/twofish_glue_3way.c
@@ -15,7 +15,7 @@
 #include "twofish.h"
 #include "ecb_cbc_helpers.h"
 
-EXPORT_SYMBOL_GPL(__twofish_enc_blk_3way);
+EXPORT_SYMBOL_GPL(twofish_enc_blk_3way);
 EXPORT_SYMBOL_GPL(twofish_dec_blk_3way);
 
 static int twofish_setkey_skcipher(struct crypto_skcipher *tfm,
@@ -24,11 +24,6 @@ static int twofish_setkey_skcipher(struct crypto_skcipher *tfm,
 	return twofish_setkey(&tfm->base, key, keylen);
 }
 
-static inline void twofish_enc_blk_3way(const void *ctx, u8 *dst, const u8 *src)
-{
-	__twofish_enc_blk_3way(ctx, dst, src, false);
-}
-
 void twofish_dec_blk_cbc_3way(const void *ctx, u8 *dst, const u8 *src)
 {
 	u8 buf[2][TF_BLOCK_SIZE];
-- 
2.39.1




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux