krb5 commit: Clean up AES-NI code
Tom Yu
tlyu at MIT.EDU
Fri Jan 10 16:33:04 EST 2014
https://github.com/krb5/krb5/commit/d658d91bb16adb5410ee2b34437630ee43cbd939
commit d658d91bb16adb5410ee2b34437630ee43cbd939
Author: Tom Yu <tlyu at mit.edu>
Date: Fri Jan 10 15:45:45 2014 -0500
Clean up AES-NI code
Items in .data other than shuffle_mask are unused; delete them.
Delete the unused macro load_and_inc4. Move shuffle_mask to .rodata.
src/lib/crypto/builtin/aes/iaesx64.s | 50 +---------------------------------
src/lib/crypto/builtin/aes/iaesx86.s | 50 +---------------------------------
2 files changed, 2 insertions(+), 98 deletions(-)
diff --git a/src/lib/crypto/builtin/aes/iaesx64.s b/src/lib/crypto/builtin/aes/iaesx64.s
index d03c859..bc7210a 100644
--- a/src/lib/crypto/builtin/aes/iaesx64.s
+++ b/src/lib/crypto/builtin/aes/iaesx64.s
@@ -128,26 +128,6 @@
%endmacro
-%macro load_and_inc4 1
- movdqa xmm4,%1
- movdqa xmm0,xmm5
- pshufb xmm0, xmm6 ; byte swap counter back
- movdqa xmm1,xmm5
- paddd xmm1,[counter_add_one wrt rip]
- pshufb xmm1, xmm6 ; byte swap counter back
- movdqa xmm2,xmm5
- paddd xmm2,[counter_add_two wrt rip]
- pshufb xmm2, xmm6 ; byte swap counter back
- movdqa xmm3,xmm5
- paddd xmm3,[counter_add_three wrt rip]
- pshufb xmm3, xmm6 ; byte swap counter back
- pxor xmm0,xmm4
- paddd xmm5,[counter_add_four wrt rip]
- pxor xmm1,xmm4
- pxor xmm2,xmm4
- pxor xmm3,xmm4
-%endmacro
-
%macro xor_with_input4 1
movdqu xmm4,[%1]
pxor xmm0,xmm4
@@ -209,7 +189,7 @@
%endmacro
-section .data
+section .rodata
align 16
shuffle_mask:
DD 0FFFFFFFFh
@@ -217,34 +197,6 @@ DD 03020100h
DD 07060504h
DD 0B0A0908h
-byte_swap_16:
-DDQ 0x000102030405060708090A0B0C0D0E0F
-
-align 16
-counter_add_one:
-DD 1
-DD 0
-DD 0
-DD 0
-
-counter_add_two:
-DD 2
-DD 0
-DD 0
-DD 0
-
-counter_add_three:
-DD 3
-DD 0
-DD 0
-DD 0
-
-counter_add_four:
-DD 4
-DD 0
-DD 0
-DD 0
-
section .text
diff --git a/src/lib/crypto/builtin/aes/iaesx86.s b/src/lib/crypto/builtin/aes/iaesx86.s
index 33470dd..945942c 100644
--- a/src/lib/crypto/builtin/aes/iaesx86.s
+++ b/src/lib/crypto/builtin/aes/iaesx86.s
@@ -138,26 +138,6 @@
%endmacro
-%macro load_and_inc4 1
- movdqa xmm4,%1
- movdqa xmm0,xmm5
- pshufb xmm0, xmm6 ; byte swap counter back
- movdqa xmm1,xmm5
- paddd xmm1,[counter_add_one]
- pshufb xmm1, xmm6 ; byte swap counter back
- movdqa xmm2,xmm5
- paddd xmm2,[counter_add_two]
- pshufb xmm2, xmm6 ; byte swap counter back
- movdqa xmm3,xmm5
- paddd xmm3,[counter_add_three]
- pshufb xmm3, xmm6 ; byte swap counter back
- pxor xmm0,xmm4
- paddd xmm5,[counter_add_four]
- pxor xmm1,xmm4
- pxor xmm2,xmm4
- pxor xmm3,xmm4
-%endmacro
-
%macro xor_with_input4 1
movdqu xmm4,[%1]
pxor xmm0,xmm4
@@ -216,7 +196,7 @@
-section .data
+section .rodata
align 16
shuffle_mask:
DD 0FFFFFFFFh
@@ -224,34 +204,6 @@ DD 03020100h
DD 07060504h
DD 0B0A0908h
-byte_swap_16:
-DDQ 0x000102030405060708090A0B0C0D0E0F
-
-align 16
-counter_add_one:
-DD 1
-DD 0
-DD 0
-DD 0
-
-counter_add_two:
-DD 2
-DD 0
-DD 0
-DD 0
-
-counter_add_three:
-DD 3
-DD 0
-DD 0
-DD 0
-
-counter_add_four:
-DD 4
-DD 0
-DD 0
-DD 0
-
section .text
More information about the cvs-krb5
mailing list