Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Peter Lafreniere <peter@n8pjl.ca>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Peter Lafreniere and committed by
Herbert Xu
b529ea65 57ead1bf

+7 -57
+4 -42
arch/x86/crypto/blowfish-x86_64-asm_64.S
··· 100 100 bswapq RX0; \ 101 101 movq RX0, (RIO); 102 102 103 - #define xor_block() \ 104 - bswapq RX0; \ 105 - xorq RX0, (RIO); 106 - 107 - SYM_FUNC_START(__blowfish_enc_blk) 103 + SYM_TYPED_FUNC_START(blowfish_enc_blk) 108 104 /* input: 109 105 * %rdi: ctx 110 106 * %rsi: dst 111 107 * %rdx: src 112 - * %rcx: bool, if true: xor output 113 108 */ 114 109 movq %r12, %r11; 115 110 ··· 125 130 add_roundkey_enc(16); 126 131 127 132 movq %r11, %r12; 128 - 129 133 movq %r10, RIO; 130 - test %cl, %cl; 131 - jnz .L__enc_xor; 132 134 133 135 write_block(); 134 136 RET; 135 - .L__enc_xor: 136 - xor_block(); 137 - RET; 138 - SYM_FUNC_END(__blowfish_enc_blk) 137 + SYM_FUNC_END(blowfish_enc_blk) 139 138 140 139 SYM_TYPED_FUNC_START(blowfish_dec_blk) 141 140 /* input: ··· 260 271 bswapq RX3; \ 261 272 movq RX3, 24(RIO); 262 273 263 - #define xor_block4() \ 264 - bswapq RX0; \ 265 - xorq RX0, (RIO); \ 266 - \ 267 - bswapq RX1; \ 268 - xorq RX1, 8(RIO); \ 269 - \ 270 - bswapq RX2; \ 271 - xorq RX2, 16(RIO); \ 272 - \ 273 - bswapq RX3; \ 274 - xorq RX3, 24(RIO); 275 - 276 - SYM_FUNC_START(__blowfish_enc_blk_4way) 274 + SYM_TYPED_FUNC_START(blowfish_enc_blk_4way) 277 275 /* input: 278 276 * %rdi: ctx 279 277 * %rsi: dst 280 278 * %rdx: src 281 - * %rcx: bool, if true: xor output 282 279 */ 283 280 pushq %r12; 284 281 pushq %rbx; 285 - pushq %rcx; 286 282 287 283 movq %rdi, CTX 288 284 movq %rsi, %r11; ··· 287 313 round_enc4(14); 288 314 add_preloaded_roundkey4(); 289 315 290 - popq %r12; 291 316 movq %r11, RIO; 292 - 293 - test %r12b, %r12b; 294 - jnz .L__enc_xor4; 295 - 296 317 write_block4(); 297 318 298 319 popq %rbx; 299 320 popq %r12; 300 321 RET; 301 - 302 - .L__enc_xor4: 303 - xor_block4(); 304 - 305 - popq %rbx; 306 - popq %r12; 307 - RET; 308 - SYM_FUNC_END(__blowfish_enc_blk_4way) 322 + SYM_FUNC_END(blowfish_enc_blk_4way) 309 323 310 324 SYM_TYPED_FUNC_START(blowfish_dec_blk_4way) 311 325 /* input:
+3 -15
arch/x86/crypto/blowfish_glue.c
··· 17 17 #include <linux/types.h> 18 18 19 19 /* regular block cipher functions */ 20 - asmlinkage void __blowfish_enc_blk(struct bf_ctx *ctx, u8 *dst, const u8 *src, 21 - bool xor); 20 + asmlinkage void blowfish_enc_blk(struct bf_ctx *ctx, u8 *dst, const u8 *src); 22 21 asmlinkage void blowfish_dec_blk(struct bf_ctx *ctx, u8 *dst, const u8 *src); 23 22 24 23 /* 4-way parallel cipher functions */ 25 - asmlinkage void __blowfish_enc_blk_4way(struct bf_ctx *ctx, u8 *dst, 26 - const u8 *src, bool xor); 24 + asmlinkage void blowfish_enc_blk_4way(struct bf_ctx *ctx, u8 *dst, 25 + const u8 *src); 27 26 asmlinkage void blowfish_dec_blk_4way(struct bf_ctx *ctx, u8 *dst, 28 27 const u8 *src); 29 - 30 - static inline void blowfish_enc_blk(struct bf_ctx *ctx, u8 *dst, const u8 *src) 31 - { 32 - __blowfish_enc_blk(ctx, dst, src, false); 33 - } 34 - 35 - static inline void blowfish_enc_blk_4way(struct bf_ctx *ctx, u8 *dst, 36 - const u8 *src) 37 - { 38 - __blowfish_enc_blk_4way(ctx, dst, src, false); 39 - } 40 28 41 29 static void blowfish_encrypt(struct crypto_tfm *tfm, u8 *dst, const u8 *src) 42 30 {