diff options
author | Andy Polyakov <appro@openssl.org> | 2006-10-17 16:13:18 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2006-10-17 16:13:18 +0000 |
commit | c5f17d45c1866ad7c65bcec66be03212ec5cc3ae (patch) | |
tree | 9d78aa080c8c1199c21dd6872543ed9f66a01c18 /crypto/sha/asm | |
parent | 31439046e0948cf2ca13586a0c935f5f23b1f346 (diff) |
Further synchronizations with md32_common.h update, consistent naming
for low-level SHA block routines.
Diffstat (limited to 'crypto/sha/asm')
-rw-r--r-- | crypto/sha/asm/sha1-586.pl | 4 | ||||
-rw-r--r-- | crypto/sha/asm/sha1-ia64.pl | 10 | ||||
-rwxr-xr-x | crypto/sha/asm/sha1-ppc.pl | 4 | ||||
-rwxr-xr-x | crypto/sha/asm/sha1-x86_64.pl | 6 | ||||
-rwxr-xr-x | crypto/sha/asm/sha512-ia64.pl | 4 | ||||
-rwxr-xr-x | crypto/sha/asm/sha512-ppc.pl | 4 | ||||
-rwxr-xr-x | crypto/sha/asm/sha512-x86_64.pl | 29 |
7 files changed, 21 insertions, 40 deletions
diff --git a/crypto/sha/asm/sha1-586.pl b/crypto/sha/asm/sha1-586.pl index 10c7d43641..0b1e1731cb 100644 --- a/crypto/sha/asm/sha1-586.pl +++ b/crypto/sha/asm/sha1-586.pl @@ -149,7 +149,7 @@ sub BODY_40_59 &add($f,$e); # f+=ROTATE(a,5) } -&function_begin("sha1_block_asm_data_order",16); +&function_begin("sha1_block_data_order",16); &mov($tmp1,&wparam(0)); # SHA_CTX *c &mov($T,&wparam(1)); # const void *input &mov($A,&wparam(2)); # size_t num @@ -214,7 +214,7 @@ sub BODY_40_59 &jb(&label("loop")); &stack_pop(16); -&function_end("sha1_block_asm_data_order"); +&function_end("sha1_block_data_order"); &asciz("SHA1 block transform for x86, CRYPTOGAMS by <appro\@openssl.org>"); &asm_finish(); diff --git a/crypto/sha/asm/sha1-ia64.pl b/crypto/sha/asm/sha1-ia64.pl index 9e2f73560f..242cadcc52 100644 --- a/crypto/sha/asm/sha1-ia64.pl +++ b/crypto/sha/asm/sha1-ia64.pl @@ -239,11 +239,11 @@ tmp3=r11; ctx=r32; // in0 inp=r33; // in1 -// void sha1_block_asm_data_order(SHA_CTX *c,const void *p,size_t num); -.global sha1_block_asm_data_order# -.proc sha1_block_asm_data_order# +// void sha1_block_data_order(SHA_CTX *c,const void *p,size_t num); +.global sha1_block_data_order# +.proc sha1_block_data_order# .align 32 -sha1_block_asm_data_order: +sha1_block_data_order: .prologue { .mmi; alloc tmp1=ar.pfs,3,15,0,0 $ADDP tmp0=4,ctx @@ -306,7 +306,7 @@ $code.=<<___; { .mib; st4 [ctx]=$h4,-16 mov pr=r2,0x1ffff br.ret.sptk.many b0 };; -.endp sha1_block_asm_data_order# +.endp sha1_block_data_order# ___ print $code; diff --git a/crypto/sha/asm/sha1-ppc.pl b/crypto/sha/asm/sha1-ppc.pl index 5c5c7d87ec..fbd051652c 100755 --- a/crypto/sha/asm/sha1-ppc.pl +++ b/crypto/sha/asm/sha1-ppc.pl @@ -158,9 +158,9 @@ ___ $code=<<___; .text -.globl .sha1_block_asm_data_order +.globl .sha1_block_data_order .align 4 -.sha1_block_asm_data_order: +.sha1_block_data_order: mflr r0 $STU $sp,`-($FRAME+64)`($sp) $PUSH r0,`$FRAME-$SIZE_T*18`($sp) diff --git a/crypto/sha/asm/sha1-x86_64.pl b/crypto/sha/asm/sha1-x86_64.pl index 857db2d671..f3cb1347fb 100755 --- a/crypto/sha/asm/sha1-x86_64.pl +++ b/crypto/sha/asm/sha1-x86_64.pl @@ -158,6 +158,8 @@ $code.=<<___ if ($i<79); rol \$30,$b add $t0,$f rol \$1,$xi +___ +$code.=<<___ if ($i<76); mov $xi,`4*($j%16)`(%rsp) ___ $code.=<<___ if ($i==79); @@ -200,7 +202,7 @@ ___ $code=".text\n"; -&PROLOGUE("sha1_block_asm_data_order"); +&PROLOGUE("sha1_block_data_order"); $code.=".align 4\n.Lloop:\n"; for($i=0;$i<20;$i++) { &BODY_00_19($i,@V); unshift(@V,pop(@V)); } for(;$i<40;$i++) { &BODY_20_39($i,@V); unshift(@V,pop(@V)); } @@ -227,7 +229,7 @@ $code.=<<___; sub \$1,$num jnz .Lloop ___ -&EPILOGUE("sha1_block_asm_data_order"); +&EPILOGUE("sha1_block_data_order"); $code.=<<___; .asciz "SHA1 block transform for x86_64, CRYPTOGAMS by <appro\@openssl.org>" ___ diff --git a/crypto/sha/asm/sha512-ia64.pl b/crypto/sha/asm/sha512-ia64.pl index 628e33e426..bba7f6bb15 100755 --- a/crypto/sha/asm/sha512-ia64.pl +++ b/crypto/sha/asm/sha512-ia64.pl @@ -71,7 +71,7 @@ if ($output =~ /512.*\.[s|asm]/) { $ADD="add"; $SHRU="shr.u"; $TABLE="K512"; - $func="sha512_block"; + $func="sha512_block_data_order"; @Sigma0=(28,34,39); @Sigma1=(14,18,41); @sigma0=(1, 8, 7); @@ -85,7 +85,7 @@ if ($output =~ /512.*\.[s|asm]/) { $ADD="padd4"; $SHRU="pshr4.u"; $TABLE="K256"; - $func="sha256_block"; + $func="sha256_block_data_order"; @Sigma0=( 2,13,22); @Sigma1=( 6,11,25); @sigma0=( 7,18, 3); diff --git a/crypto/sha/asm/sha512-ppc.pl b/crypto/sha/asm/sha512-ppc.pl index b866f93eef..877d172215 100755 --- a/crypto/sha/asm/sha512-ppc.pl +++ b/crypto/sha/asm/sha512-ppc.pl @@ -41,7 +41,7 @@ if ($output =~ /64/) { die "can't call ../perlasm/ppc-xlate.pl: $!"; if ($output =~ /512/) { - $func="sha512_block"; + $func="sha512_block_data_order"; $SZ=8; @Sigma0=(28,34,39); @Sigma1=(14,18,41); @@ -53,7 +53,7 @@ if ($output =~ /512/) { $ROR="rotrdi"; $SHR="srdi"; } else { - $func="sha256_block"; + $func="sha256_block_data_order"; $SZ=4; @Sigma0=( 2,13,22); @Sigma1=( 6,11,25); diff --git a/crypto/sha/asm/sha512-x86_64.pl b/crypto/sha/asm/sha512-x86_64.pl index 38157b610c..4cf5c623d6 100755 --- a/crypto/sha/asm/sha512-x86_64.pl +++ b/crypto/sha/asm/sha512-x86_64.pl @@ -44,7 +44,7 @@ $output=shift; open STDOUT,"| $^X ../perlasm/x86_64-xlate.pl $output"; if ($output =~ /512/) { - $func="sha512_block"; + $func="sha512_block_data_order"; $TABLE="K512"; $SZ=8; @ROT=($A,$B,$C,$D,$E,$F,$G,$H)=("%rax","%rbx","%rcx","%rdx", @@ -56,7 +56,7 @@ if ($output =~ /512/) { @sigma1=(19,61, 6); $rounds=80; } else { - $func="sha256_block"; + $func="sha256_block_data_order"; $TABLE="K256"; $SZ=4; @ROT=($A,$B,$C,$D,$E,$F,$G,$H)=("%eax","%ebx","%ecx","%edx", @@ -77,9 +77,8 @@ $Tbl="%rbp"; $_ctx="16*$SZ+0*8(%rsp)"; $_inp="16*$SZ+1*8(%rsp)"; $_end="16*$SZ+2*8(%rsp)"; -$_ord="16*$SZ+3*8(%rsp)"; -$_rsp="16*$SZ+4*8(%rsp)"; -$framesz="16*$SZ+5*8"; +$_rsp="16*$SZ+3*8(%rsp)"; +$framesz="16*$SZ+4*8"; sub ROUND_00_15() @@ -189,7 +188,6 @@ $func: mov $ctx,$_ctx # save ctx, 1st arg mov $inp,$_inp # save inp, 2nd arh mov %rdx,$_end # save end pointer, "3rd" arg - mov %ecx,$_ord # save host, 4th arg mov %rbp,$_rsp # save copy of %rsp .picmeup $Tbl @@ -209,25 +207,6 @@ $func: .Lloop: xor $round,$round ___ -if ($SZ==4) { -$code.=<<___; - cmpl \$0,$_ord - je .Ldata_order -.align 16 -.Lhost_order: -___ - - for($i=0;$i<16;$i++) { - $code.=" mov $SZ*$i($inp),$T1\n"; - &ROUND_00_15($i,@ROT); - unshift(@ROT,pop(@ROT)); - } -$code.=<<___; - jmp .Lrounds_16_xx -.align 16 -.Ldata_order: -___ -} # 256 for($i=0;$i<16;$i++) { $code.=" mov $SZ*$i($inp),$T1\n"; $code.=" bswap $T1\n"; |