@@ -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:
@@ -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 */
@@ -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);
@@ -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];
__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@n8pjl.ca> --- 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(-)