提交 2dcfd44d 编写于 作者: J Jussi Kivilinna 提交者: Herbert Xu

crypto: x86/serpent - use ENTRY/ENDPROC for assember functions and localize jump targets

Signed-off-by: NJussi Kivilinna <jussi.kivilinna@mbnet.fi>
Acked-by: NDavid S. Miller <davem@davemloft.net>
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 04443808
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
* *
*/ */
#include <linux/linkage.h>
#include "glue_helper-asm-avx.S" #include "glue_helper-asm-avx.S"
.file "serpent-avx-x86_64-asm_64.S" .file "serpent-avx-x86_64-asm_64.S"
...@@ -566,8 +567,6 @@ ...@@ -566,8 +567,6 @@
transpose_4x4(x0, x1, x2, x3, t0, t1, t2) transpose_4x4(x0, x1, x2, x3, t0, t1, t2)
.align 8 .align 8
.type __serpent_enc_blk8_avx,@function;
__serpent_enc_blk8_avx: __serpent_enc_blk8_avx:
/* input: /* input:
* %rdi: ctx, CTX * %rdi: ctx, CTX
...@@ -619,10 +618,9 @@ __serpent_enc_blk8_avx: ...@@ -619,10 +618,9 @@ __serpent_enc_blk8_avx:
write_blocks(RA2, RB2, RC2, RD2, RK0, RK1, RK2); write_blocks(RA2, RB2, RC2, RD2, RK0, RK1, RK2);
ret; ret;
ENDPROC(__serpent_enc_blk8_avx)
.align 8 .align 8
.type __serpent_dec_blk8_avx,@function;
__serpent_dec_blk8_avx: __serpent_dec_blk8_avx:
/* input: /* input:
* %rdi: ctx, CTX * %rdi: ctx, CTX
...@@ -674,12 +672,9 @@ __serpent_dec_blk8_avx: ...@@ -674,12 +672,9 @@ __serpent_dec_blk8_avx:
write_blocks(RC2, RD2, RB2, RE2, RK0, RK1, RK2); write_blocks(RC2, RD2, RB2, RE2, RK0, RK1, RK2);
ret; ret;
ENDPROC(__serpent_dec_blk8_avx)
.align 8 ENTRY(serpent_ecb_enc_8way_avx)
.global serpent_ecb_enc_8way_avx
.type serpent_ecb_enc_8way_avx,@function;
serpent_ecb_enc_8way_avx:
/* input: /* input:
* %rdi: ctx, CTX * %rdi: ctx, CTX
* %rsi: dst * %rsi: dst
...@@ -693,12 +688,9 @@ serpent_ecb_enc_8way_avx: ...@@ -693,12 +688,9 @@ serpent_ecb_enc_8way_avx:
store_8way(%rsi, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2); store_8way(%rsi, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
ret; ret;
ENDPROC(serpent_ecb_enc_8way_avx)
.align 8 ENTRY(serpent_ecb_dec_8way_avx)
.global serpent_ecb_dec_8way_avx
.type serpent_ecb_dec_8way_avx,@function;
serpent_ecb_dec_8way_avx:
/* input: /* input:
* %rdi: ctx, CTX * %rdi: ctx, CTX
* %rsi: dst * %rsi: dst
...@@ -712,12 +704,9 @@ serpent_ecb_dec_8way_avx: ...@@ -712,12 +704,9 @@ serpent_ecb_dec_8way_avx:
store_8way(%rsi, RC1, RD1, RB1, RE1, RC2, RD2, RB2, RE2); store_8way(%rsi, RC1, RD1, RB1, RE1, RC2, RD2, RB2, RE2);
ret; ret;
ENDPROC(serpent_ecb_dec_8way_avx)
.align 8 ENTRY(serpent_cbc_dec_8way_avx)
.global serpent_cbc_dec_8way_avx
.type serpent_cbc_dec_8way_avx,@function;
serpent_cbc_dec_8way_avx:
/* input: /* input:
* %rdi: ctx, CTX * %rdi: ctx, CTX
* %rsi: dst * %rsi: dst
...@@ -731,12 +720,9 @@ serpent_cbc_dec_8way_avx: ...@@ -731,12 +720,9 @@ serpent_cbc_dec_8way_avx:
store_cbc_8way(%rdx, %rsi, RC1, RD1, RB1, RE1, RC2, RD2, RB2, RE2); store_cbc_8way(%rdx, %rsi, RC1, RD1, RB1, RE1, RC2, RD2, RB2, RE2);
ret; ret;
ENDPROC(serpent_cbc_dec_8way_avx)
.align 8 ENTRY(serpent_ctr_8way_avx)
.global serpent_ctr_8way_avx
.type serpent_ctr_8way_avx,@function;
serpent_ctr_8way_avx:
/* input: /* input:
* %rdi: ctx, CTX * %rdi: ctx, CTX
* %rsi: dst * %rsi: dst
...@@ -752,3 +738,4 @@ serpent_ctr_8way_avx: ...@@ -752,3 +738,4 @@ serpent_ctr_8way_avx:
store_ctr_8way(%rdx, %rsi, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2); store_ctr_8way(%rdx, %rsi, RA1, RB1, RC1, RD1, RA2, RB2, RC2, RD2);
ret; ret;
ENDPROC(serpent_ctr_8way_avx)
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
* *
*/ */
#include <linux/linkage.h>
.file "serpent-sse2-i586-asm_32.S" .file "serpent-sse2-i586-asm_32.S"
.text .text
...@@ -510,11 +512,7 @@ ...@@ -510,11 +512,7 @@
pxor t0, x3; \ pxor t0, x3; \
movdqu x3, (3*4*4)(out); movdqu x3, (3*4*4)(out);
.align 8 ENTRY(__serpent_enc_blk_4way)
.global __serpent_enc_blk_4way
.type __serpent_enc_blk_4way,@function;
__serpent_enc_blk_4way:
/* input: /* input:
* arg_ctx(%esp): ctx, CTX * arg_ctx(%esp): ctx, CTX
* arg_dst(%esp): dst * arg_dst(%esp): dst
...@@ -566,22 +564,19 @@ __serpent_enc_blk_4way: ...@@ -566,22 +564,19 @@ __serpent_enc_blk_4way:
movl arg_dst(%esp), %eax; movl arg_dst(%esp), %eax;
cmpb $0, arg_xor(%esp); cmpb $0, arg_xor(%esp);
jnz __enc_xor4; jnz .L__enc_xor4;
write_blocks(%eax, RA, RB, RC, RD, RT0, RT1, RE); write_blocks(%eax, RA, RB, RC, RD, RT0, RT1, RE);
ret; ret;
__enc_xor4: .L__enc_xor4:
xor_blocks(%eax, RA, RB, RC, RD, RT0, RT1, RE); xor_blocks(%eax, RA, RB, RC, RD, RT0, RT1, RE);
ret; ret;
ENDPROC(__serpent_enc_blk_4way)
.align 8 ENTRY(serpent_dec_blk_4way)
.global serpent_dec_blk_4way
.type serpent_dec_blk_4way,@function;
serpent_dec_blk_4way:
/* input: /* input:
* arg_ctx(%esp): ctx, CTX * arg_ctx(%esp): ctx, CTX
* arg_dst(%esp): dst * arg_dst(%esp): dst
...@@ -633,3 +628,4 @@ serpent_dec_blk_4way: ...@@ -633,3 +628,4 @@ serpent_dec_blk_4way:
write_blocks(%eax, RC, RD, RB, RE, RT0, RT1, RA); write_blocks(%eax, RC, RD, RB, RE, RT0, RT1, RA);
ret; ret;
ENDPROC(serpent_dec_blk_4way)
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
* *
*/ */
#include <linux/linkage.h>
.file "serpent-sse2-x86_64-asm_64.S" .file "serpent-sse2-x86_64-asm_64.S"
.text .text
...@@ -632,11 +634,7 @@ ...@@ -632,11 +634,7 @@
pxor t0, x3; \ pxor t0, x3; \
movdqu x3, (3*4*4)(out); movdqu x3, (3*4*4)(out);
.align 8 ENTRY(__serpent_enc_blk_8way)
.global __serpent_enc_blk_8way
.type __serpent_enc_blk_8way,@function;
__serpent_enc_blk_8way:
/* input: /* input:
* %rdi: ctx, CTX * %rdi: ctx, CTX
* %rsi: dst * %rsi: dst
...@@ -687,24 +685,21 @@ __serpent_enc_blk_8way: ...@@ -687,24 +685,21 @@ __serpent_enc_blk_8way:
leaq (4*4*4)(%rsi), %rax; leaq (4*4*4)(%rsi), %rax;
testb %cl, %cl; testb %cl, %cl;
jnz __enc_xor8; jnz .L__enc_xor8;
write_blocks(%rsi, RA1, RB1, RC1, RD1, RK0, RK1, RK2); write_blocks(%rsi, RA1, RB1, RC1, RD1, RK0, RK1, RK2);
write_blocks(%rax, RA2, RB2, RC2, RD2, RK0, RK1, RK2); write_blocks(%rax, RA2, RB2, RC2, RD2, RK0, RK1, RK2);
ret; ret;
__enc_xor8: .L__enc_xor8:
xor_blocks(%rsi, RA1, RB1, RC1, RD1, RK0, RK1, RK2); xor_blocks(%rsi, RA1, RB1, RC1, RD1, RK0, RK1, RK2);
xor_blocks(%rax, RA2, RB2, RC2, RD2, RK0, RK1, RK2); xor_blocks(%rax, RA2, RB2, RC2, RD2, RK0, RK1, RK2);
ret; ret;
ENDPROC(__serpent_enc_blk_8way)
.align 8 ENTRY(serpent_dec_blk_8way)
.global serpent_dec_blk_8way
.type serpent_dec_blk_8way,@function;
serpent_dec_blk_8way:
/* input: /* input:
* %rdi: ctx, CTX * %rdi: ctx, CTX
* %rsi: dst * %rsi: dst
...@@ -756,3 +751,4 @@ serpent_dec_blk_8way: ...@@ -756,3 +751,4 @@ serpent_dec_blk_8way:
write_blocks(%rax, RC2, RD2, RB2, RE2, RK0, RK1, RK2); write_blocks(%rax, RC2, RD2, RB2, RE2, RK0, RK1, RK2);
ret; ret;
ENDPROC(serpent_dec_blk_8way)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册