Commit b529ea65 authored by Peter Lafreniere's avatar Peter Lafreniere Committed by Herbert Xu

crypto: x86/blowfish - Remove unused encode parameter

The blowfish-x86_64 encryption functions have an unused argument. Remove
it.

This involves:
 1 - Removing xor_block() macros.
 2 - Removing handling of fourth argument from __blowfish_enc_blk{,_4way}()
     functions.
 3 - Renaming __blowfish_enc_blk{,_4way}() to blowfish_enc_blk{,_4way}().
 4 - Removing the blowfish_enc_blk{,_4way}() wrappers from
     blowfish_glue.c
 5 - Temporarily using SYM_TYPED_FUNC_START for now indirectly-callable
     encode functions.
Signed-off-by: default avatarPeter Lafreniere <peter@n8pjl.ca>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 57ead1bf
...@@ -100,16 +100,11 @@ ...@@ -100,16 +100,11 @@
bswapq RX0; \ bswapq RX0; \
movq RX0, (RIO); movq RX0, (RIO);
#define xor_block() \ SYM_TYPED_FUNC_START(blowfish_enc_blk)
bswapq RX0; \
xorq RX0, (RIO);
SYM_FUNC_START(__blowfish_enc_blk)
/* input: /* input:
* %rdi: ctx * %rdi: ctx
* %rsi: dst * %rsi: dst
* %rdx: src * %rdx: src
* %rcx: bool, if true: xor output
*/ */
movq %r12, %r11; movq %r12, %r11;
...@@ -130,17 +125,11 @@ SYM_FUNC_START(__blowfish_enc_blk) ...@@ -130,17 +125,11 @@ SYM_FUNC_START(__blowfish_enc_blk)
add_roundkey_enc(16); add_roundkey_enc(16);
movq %r11, %r12; movq %r11, %r12;
movq %r10, RIO; movq %r10, RIO;
test %cl, %cl;
jnz .L__enc_xor;
write_block(); write_block();
RET; RET;
.L__enc_xor: SYM_FUNC_END(blowfish_enc_blk)
xor_block();
RET;
SYM_FUNC_END(__blowfish_enc_blk)
SYM_TYPED_FUNC_START(blowfish_dec_blk) SYM_TYPED_FUNC_START(blowfish_dec_blk)
/* input: /* input:
...@@ -271,29 +260,14 @@ SYM_FUNC_END(blowfish_dec_blk) ...@@ -271,29 +260,14 @@ SYM_FUNC_END(blowfish_dec_blk)
bswapq RX3; \ bswapq RX3; \
movq RX3, 24(RIO); movq RX3, 24(RIO);
#define xor_block4() \ SYM_TYPED_FUNC_START(blowfish_enc_blk_4way)
bswapq RX0; \
xorq RX0, (RIO); \
\
bswapq RX1; \
xorq RX1, 8(RIO); \
\
bswapq RX2; \
xorq RX2, 16(RIO); \
\
bswapq RX3; \
xorq RX3, 24(RIO);
SYM_FUNC_START(__blowfish_enc_blk_4way)
/* input: /* input:
* %rdi: ctx * %rdi: ctx
* %rsi: dst * %rsi: dst
* %rdx: src * %rdx: src
* %rcx: bool, if true: xor output
*/ */
pushq %r12; pushq %r12;
pushq %rbx; pushq %rbx;
pushq %rcx;
movq %rdi, CTX movq %rdi, CTX
movq %rsi, %r11; movq %rsi, %r11;
...@@ -313,25 +287,13 @@ SYM_FUNC_START(__blowfish_enc_blk_4way) ...@@ -313,25 +287,13 @@ SYM_FUNC_START(__blowfish_enc_blk_4way)
round_enc4(14); round_enc4(14);
add_preloaded_roundkey4(); add_preloaded_roundkey4();
popq %r12;
movq %r11, RIO; movq %r11, RIO;
test %r12b, %r12b;
jnz .L__enc_xor4;
write_block4(); write_block4();
popq %rbx; popq %rbx;
popq %r12; popq %r12;
RET; RET;
SYM_FUNC_END(blowfish_enc_blk_4way)
.L__enc_xor4:
xor_block4();
popq %rbx;
popq %r12;
RET;
SYM_FUNC_END(__blowfish_enc_blk_4way)
SYM_TYPED_FUNC_START(blowfish_dec_blk_4way) SYM_TYPED_FUNC_START(blowfish_dec_blk_4way)
/* input: /* input:
......
...@@ -17,27 +17,15 @@ ...@@ -17,27 +17,15 @@
#include <linux/types.h> #include <linux/types.h>
/* regular block cipher functions */ /* regular block cipher functions */
asmlinkage void __blowfish_enc_blk(struct bf_ctx *ctx, u8 *dst, const u8 *src, asmlinkage void blowfish_enc_blk(struct bf_ctx *ctx, u8 *dst, const u8 *src);
bool xor);
asmlinkage void blowfish_dec_blk(struct bf_ctx *ctx, u8 *dst, const u8 *src); asmlinkage void blowfish_dec_blk(struct bf_ctx *ctx, u8 *dst, const u8 *src);
/* 4-way parallel cipher functions */ /* 4-way parallel cipher functions */
asmlinkage void __blowfish_enc_blk_4way(struct bf_ctx *ctx, u8 *dst, asmlinkage void blowfish_enc_blk_4way(struct bf_ctx *ctx, u8 *dst,
const u8 *src, bool xor); const u8 *src);
asmlinkage void blowfish_dec_blk_4way(struct bf_ctx *ctx, u8 *dst, asmlinkage void blowfish_dec_blk_4way(struct bf_ctx *ctx, u8 *dst,
const u8 *src); const u8 *src);
static inline void blowfish_enc_blk(struct bf_ctx *ctx, u8 *dst, const u8 *src)
{
__blowfish_enc_blk(ctx, dst, src, false);
}
static inline void blowfish_enc_blk_4way(struct bf_ctx *ctx, u8 *dst,
const u8 *src)
{
__blowfish_enc_blk_4way(ctx, dst, src, false);
}
static void blowfish_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) static void blowfish_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src)
{ {
blowfish_enc_blk(crypto_tfm_ctx(tfm), dst, src); blowfish_enc_blk(crypto_tfm_ctx(tfm), dst, src);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment