aboutsummaryrefslogtreecommitdiffstats
path: root/modules/sha_x86
diff options
context:
space:
mode:
authorlloyd <[email protected]>2006-08-12 20:07:58 +0000
committerlloyd <[email protected]>2006-08-12 20:07:58 +0000
commit7bf3ea8282cdb3edf9504c9c9c2e13c8fa6edbfc (patch)
tree303693497990f1c6c702c4dedf05c632ede2de37 /modules/sha_x86
parentd33208a79b85599deab30fdbbd6ad11e4748a8a1 (diff)
Unroll the expansion loop
Diffstat (limited to 'modules/sha_x86')
-rw-r--r--modules/sha_x86/sha1core.S44
1 files changed, 36 insertions, 8 deletions
diff --git a/modules/sha_x86/sha1core.S b/modules/sha_x86/sha1core.S
index 1152806d0..64611a00e 100644
--- a/modules/sha_x86/sha1core.S
+++ b/modules/sha_x86/sha1core.S
@@ -26,20 +26,48 @@ sha160_core:
cmpl $16, %esi
jne .LOAD_INPUT_LOOP
- leal 64(%edi), %edx
+ leal 64(%edi), %ebp
.p2align 4,,7
// here esi == 16
.EXPANSION_LOOP:
- movl -32(%edx), %eax
- xorl -12(%edx), %eax
- xorl -56(%edx), %eax
- xorl -64(%edx), %eax
- incl %esi
+ movl -12(%ebp), %eax
+ xorl -32(%ebp), %eax
+ xorl -56(%ebp), %eax
+ xorl -64(%ebp), %eax
+ roll $1, %eax
+
+ movl %eax, (%ebp)
+
+ movl -8(%ebp), %ebx
+ xorl -28(%ebp), %ebx
+ xorl -52(%ebp), %ebx
+ xorl -60(%ebp), %ebx
+ roll $1, %ebx
+
+ movl %ebx, 4(%ebp)
+
+ movl -4(%ebp), %ecx
+ xorl -24(%ebp), %ecx
+ xorl -48(%ebp), %ecx
+ xorl -56(%ebp), %ecx
+ roll $1, %ecx
+
+ movl %ecx, 8(%ebp)
+
+ movl (%ebp), %eax
+ xorl -20(%ebp), %eax
+ xorl -44(%ebp), %eax
+ xorl -52(%ebp), %eax
roll $1, %eax
- movl %eax, (%edx)
- addl $4, %edx
+ movl %eax, 12(%ebp)
+
+
+ addl $16, %ebp
+
+ addl $4, %esi
+
cmpl $80, %esi
jne .EXPANSION_LOOP