diff options
author | miod <> | 2014-04-13 15:16:40 +0000 |
---|---|---|
committer | miod <> | 2014-04-13 15:16:40 +0000 |
commit | 92349eb53934e1b3e9b807e603d45417a6320d21 (patch) | |
tree | 0de23bccc2c4fc24d466d6a4291987efc8e44770 /src/lib/libcrypto/sha | |
parent | bdcc75be513421611e357921c457c3c5f631a14c (diff) | |
parent | 52628ee3f51f011b463aaedb1a28aa0524b43cb3 (diff) | |
download | openbsd-92349eb53934e1b3e9b807e603d45417a6320d21.tar.gz openbsd-92349eb53934e1b3e9b807e603d45417a6320d21.tar.bz2 openbsd-92349eb53934e1b3e9b807e603d45417a6320d21.zip |
This commit was generated by cvs2git to track changes on a CVS vendor
branch.
Diffstat (limited to 'src/lib/libcrypto/sha')
-rw-r--r-- | src/lib/libcrypto/sha/asm/sha1-armv4-large.pl | 2 | ||||
-rw-r--r-- | src/lib/libcrypto/sha/asm/sha1-ia64.pl | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/sha/asm/sha1-parisc.pl | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/sha/asm/sha1-sparcv9a.pl | 2 | ||||
-rwxr-xr-x | src/lib/libcrypto/sha/asm/sha1-x86_64.pl | 7 | ||||
-rw-r--r-- | src/lib/libcrypto/sha/asm/sha512-586.pl | 16 | ||||
-rw-r--r-- | src/lib/libcrypto/sha/asm/sha512-mips.pl | 2 | ||||
-rwxr-xr-x | src/lib/libcrypto/sha/asm/sha512-parisc.pl | 2 | ||||
-rwxr-xr-x | src/lib/libcrypto/sha/asm/sha512-x86_64.pl | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/sha/sha256.c | 6 |
10 files changed, 26 insertions, 20 deletions
diff --git a/src/lib/libcrypto/sha/asm/sha1-armv4-large.pl b/src/lib/libcrypto/sha/asm/sha1-armv4-large.pl index fe8207f77f..33da3e0e3c 100644 --- a/src/lib/libcrypto/sha/asm/sha1-armv4-large.pl +++ b/src/lib/libcrypto/sha/asm/sha1-armv4-large.pl | |||
@@ -177,6 +177,7 @@ for($i=0;$i<5;$i++) { | |||
177 | $code.=<<___; | 177 | $code.=<<___; |
178 | teq $Xi,sp | 178 | teq $Xi,sp |
179 | bne .L_00_15 @ [((11+4)*5+2)*3] | 179 | bne .L_00_15 @ [((11+4)*5+2)*3] |
180 | sub sp,sp,#25*4 | ||
180 | ___ | 181 | ___ |
181 | &BODY_00_15(@V); unshift(@V,pop(@V)); | 182 | &BODY_00_15(@V); unshift(@V,pop(@V)); |
182 | &BODY_16_19(@V); unshift(@V,pop(@V)); | 183 | &BODY_16_19(@V); unshift(@V,pop(@V)); |
@@ -186,7 +187,6 @@ ___ | |||
186 | $code.=<<___; | 187 | $code.=<<___; |
187 | 188 | ||
188 | ldr $K,.LK_20_39 @ [+15+16*4] | 189 | ldr $K,.LK_20_39 @ [+15+16*4] |
189 | sub sp,sp,#25*4 | ||
190 | cmn sp,#0 @ [+3], clear carry to denote 20_39 | 190 | cmn sp,#0 @ [+3], clear carry to denote 20_39 |
191 | .L_20_39_or_60_79: | 191 | .L_20_39_or_60_79: |
192 | ___ | 192 | ___ |
diff --git a/src/lib/libcrypto/sha/asm/sha1-ia64.pl b/src/lib/libcrypto/sha/asm/sha1-ia64.pl index db28f0805a..02d35d1614 100644 --- a/src/lib/libcrypto/sha/asm/sha1-ia64.pl +++ b/src/lib/libcrypto/sha/asm/sha1-ia64.pl | |||
@@ -271,7 +271,8 @@ tmp6=loc13; | |||
271 | 271 | ||
272 | ___ | 272 | ___ |
273 | 273 | ||
274 | { my $i,@V=($A,$B,$C,$D,$E); | 274 | { my $i; |
275 | my @V=($A,$B,$C,$D,$E); | ||
275 | 276 | ||
276 | for($i=0;$i<16;$i++) { &BODY_00_15(\$code,$i,@V); unshift(@V,pop(@V)); } | 277 | for($i=0;$i<16;$i++) { &BODY_00_15(\$code,$i,@V); unshift(@V,pop(@V)); } |
277 | for(;$i<20;$i++) { &BODY_16_19(\$code,$i,@V); unshift(@V,pop(@V)); } | 278 | for(;$i<20;$i++) { &BODY_16_19(\$code,$i,@V); unshift(@V,pop(@V)); } |
diff --git a/src/lib/libcrypto/sha/asm/sha1-parisc.pl b/src/lib/libcrypto/sha/asm/sha1-parisc.pl index 6d7bf495b2..6e5a328a6f 100644 --- a/src/lib/libcrypto/sha/asm/sha1-parisc.pl +++ b/src/lib/libcrypto/sha/asm/sha1-parisc.pl | |||
@@ -254,6 +254,7 @@ $code.=<<___; | |||
254 | ___ | 254 | ___ |
255 | 255 | ||
256 | $code =~ s/\`([^\`]*)\`/eval $1/gem; | 256 | $code =~ s/\`([^\`]*)\`/eval $1/gem; |
257 | $code =~ s/,\*/,/gm if ($SIZE_T==4); | 257 | $code =~ s/,\*/,/gm if ($SIZE_T==4); |
258 | $code =~ s/\bbv\b/bve/gm if ($SIZE_T==8); | ||
258 | print $code; | 259 | print $code; |
259 | close STDOUT; | 260 | close STDOUT; |
diff --git a/src/lib/libcrypto/sha/asm/sha1-sparcv9a.pl b/src/lib/libcrypto/sha/asm/sha1-sparcv9a.pl index 85e8d68086..e65291bbd9 100644 --- a/src/lib/libcrypto/sha/asm/sha1-sparcv9a.pl +++ b/src/lib/libcrypto/sha/asm/sha1-sparcv9a.pl | |||
@@ -549,7 +549,7 @@ ___ | |||
549 | # programmer detect if current CPU is VIS capable at run-time. | 549 | # programmer detect if current CPU is VIS capable at run-time. |
550 | sub unvis { | 550 | sub unvis { |
551 | my ($mnemonic,$rs1,$rs2,$rd)=@_; | 551 | my ($mnemonic,$rs1,$rs2,$rd)=@_; |
552 | my $ref,$opf; | 552 | my ($ref,$opf); |
553 | my %visopf = ( "fmul8ulx16" => 0x037, | 553 | my %visopf = ( "fmul8ulx16" => 0x037, |
554 | "faligndata" => 0x048, | 554 | "faligndata" => 0x048, |
555 | "fpadd32" => 0x052, | 555 | "fpadd32" => 0x052, |
diff --git a/src/lib/libcrypto/sha/asm/sha1-x86_64.pl b/src/lib/libcrypto/sha/asm/sha1-x86_64.pl index f27c1e3fb0..f15c7ec39b 100755 --- a/src/lib/libcrypto/sha/asm/sha1-x86_64.pl +++ b/src/lib/libcrypto/sha/asm/sha1-x86_64.pl | |||
@@ -82,7 +82,8 @@ $avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) && | |||
82 | `ml64 2>&1` =~ /Version ([0-9]+)\./ && | 82 | `ml64 2>&1` =~ /Version ([0-9]+)\./ && |
83 | $1>=10); | 83 | $1>=10); |
84 | 84 | ||
85 | open STDOUT,"| $^X $xlate $flavour $output"; | 85 | open OUT,"| \"$^X\" $xlate $flavour $output"; |
86 | *STDOUT=*OUT; | ||
86 | 87 | ||
87 | $ctx="%rdi"; # 1st arg | 88 | $ctx="%rdi"; # 1st arg |
88 | $inp="%rsi"; # 2nd arg | 89 | $inp="%rsi"; # 2nd arg |
@@ -744,7 +745,7 @@ $code.=<<___; | |||
744 | mov %rdi,$ctx # reassigned argument | 745 | mov %rdi,$ctx # reassigned argument |
745 | mov %rsi,$inp # reassigned argument | 746 | mov %rsi,$inp # reassigned argument |
746 | mov %rdx,$num # reassigned argument | 747 | mov %rdx,$num # reassigned argument |
747 | vzeroall | 748 | vzeroupper |
748 | 749 | ||
749 | shl \$6,$num | 750 | shl \$6,$num |
750 | add $inp,$num | 751 | add $inp,$num |
@@ -1037,7 +1038,7 @@ ___ | |||
1037 | &Xtail_avx(\&body_20_39); | 1038 | &Xtail_avx(\&body_20_39); |
1038 | 1039 | ||
1039 | $code.=<<___; | 1040 | $code.=<<___; |
1040 | vzeroall | 1041 | vzeroupper |
1041 | 1042 | ||
1042 | add 0($ctx),$A # update context | 1043 | add 0($ctx),$A # update context |
1043 | add 4($ctx),@T[0] | 1044 | add 4($ctx),@T[0] |
diff --git a/src/lib/libcrypto/sha/asm/sha512-586.pl b/src/lib/libcrypto/sha/asm/sha512-586.pl index 5b9f3337ad..7eab6a5b88 100644 --- a/src/lib/libcrypto/sha/asm/sha512-586.pl +++ b/src/lib/libcrypto/sha/asm/sha512-586.pl | |||
@@ -142,9 +142,9 @@ sub BODY_00_15_x86 { | |||
142 | &mov ("edx",$Ehi); | 142 | &mov ("edx",$Ehi); |
143 | &mov ("esi","ecx"); | 143 | &mov ("esi","ecx"); |
144 | 144 | ||
145 | &shr ("ecx",9) # lo>>9 | 145 | &shr ("ecx",9); # lo>>9 |
146 | &mov ("edi","edx"); | 146 | &mov ("edi","edx"); |
147 | &shr ("edx",9) # hi>>9 | 147 | &shr ("edx",9); # hi>>9 |
148 | &mov ("ebx","ecx"); | 148 | &mov ("ebx","ecx"); |
149 | &shl ("esi",14); # lo<<14 | 149 | &shl ("esi",14); # lo<<14 |
150 | &mov ("eax","edx"); | 150 | &mov ("eax","edx"); |
@@ -207,9 +207,9 @@ sub BODY_00_15_x86 { | |||
207 | &mov ($Dhi,"ebx"); | 207 | &mov ($Dhi,"ebx"); |
208 | &mov ("esi","ecx"); | 208 | &mov ("esi","ecx"); |
209 | 209 | ||
210 | &shr ("ecx",2) # lo>>2 | 210 | &shr ("ecx",2); # lo>>2 |
211 | &mov ("edi","edx"); | 211 | &mov ("edi","edx"); |
212 | &shr ("edx",2) # hi>>2 | 212 | &shr ("edx",2); # hi>>2 |
213 | &mov ("ebx","ecx"); | 213 | &mov ("ebx","ecx"); |
214 | &shl ("esi",4); # lo<<4 | 214 | &shl ("esi",4); # lo<<4 |
215 | &mov ("eax","edx"); | 215 | &mov ("eax","edx"); |
@@ -452,9 +452,9 @@ if ($sse2) { | |||
452 | &mov ("edx",&DWP(8*(9+15+16-1)+4,"esp")); | 452 | &mov ("edx",&DWP(8*(9+15+16-1)+4,"esp")); |
453 | &mov ("esi","ecx"); | 453 | &mov ("esi","ecx"); |
454 | 454 | ||
455 | &shr ("ecx",1) # lo>>1 | 455 | &shr ("ecx",1); # lo>>1 |
456 | &mov ("edi","edx"); | 456 | &mov ("edi","edx"); |
457 | &shr ("edx",1) # hi>>1 | 457 | &shr ("edx",1); # hi>>1 |
458 | &mov ("eax","ecx"); | 458 | &mov ("eax","ecx"); |
459 | &shl ("esi",24); # lo<<24 | 459 | &shl ("esi",24); # lo<<24 |
460 | &mov ("ebx","edx"); | 460 | &mov ("ebx","edx"); |
@@ -488,9 +488,9 @@ if ($sse2) { | |||
488 | &mov ("edx",&DWP(8*(9+15+16-14)+4,"esp")); | 488 | &mov ("edx",&DWP(8*(9+15+16-14)+4,"esp")); |
489 | &mov ("esi","ecx"); | 489 | &mov ("esi","ecx"); |
490 | 490 | ||
491 | &shr ("ecx",6) # lo>>6 | 491 | &shr ("ecx",6); # lo>>6 |
492 | &mov ("edi","edx"); | 492 | &mov ("edi","edx"); |
493 | &shr ("edx",6) # hi>>6 | 493 | &shr ("edx",6); # hi>>6 |
494 | &mov ("eax","ecx"); | 494 | &mov ("eax","ecx"); |
495 | &shl ("esi",3); # lo<<3 | 495 | &shl ("esi",3); # lo<<3 |
496 | &mov ("ebx","edx"); | 496 | &mov ("ebx","edx"); |
diff --git a/src/lib/libcrypto/sha/asm/sha512-mips.pl b/src/lib/libcrypto/sha/asm/sha512-mips.pl index ba5b250890..ffa053bb7d 100644 --- a/src/lib/libcrypto/sha/asm/sha512-mips.pl +++ b/src/lib/libcrypto/sha/asm/sha512-mips.pl | |||
@@ -351,7 +351,7 @@ $code.=<<___; | |||
351 | $ST $G,6*$SZ($ctx) | 351 | $ST $G,6*$SZ($ctx) |
352 | $ST $H,7*$SZ($ctx) | 352 | $ST $H,7*$SZ($ctx) |
353 | 353 | ||
354 | bnel $inp,@X[15],.Loop | 354 | bne $inp,@X[15],.Loop |
355 | $PTR_SUB $Ktbl,`($rounds-16)*$SZ` # rewind $Ktbl | 355 | $PTR_SUB $Ktbl,`($rounds-16)*$SZ` # rewind $Ktbl |
356 | 356 | ||
357 | $REG_L $ra,$FRAMESIZE-1*$SZREG($sp) | 357 | $REG_L $ra,$FRAMESIZE-1*$SZREG($sp) |
diff --git a/src/lib/libcrypto/sha/asm/sha512-parisc.pl b/src/lib/libcrypto/sha/asm/sha512-parisc.pl index e24ee58ae9..fc0e15b3c0 100755 --- a/src/lib/libcrypto/sha/asm/sha512-parisc.pl +++ b/src/lib/libcrypto/sha/asm/sha512-parisc.pl | |||
@@ -785,6 +785,8 @@ foreach (split("\n",$code)) { | |||
785 | 785 | ||
786 | s/cmpb,\*/comb,/ if ($SIZE_T==4); | 786 | s/cmpb,\*/comb,/ if ($SIZE_T==4); |
787 | 787 | ||
788 | s/\bbv\b/bve/ if ($SIZE_T==8); | ||
789 | |||
788 | print $_,"\n"; | 790 | print $_,"\n"; |
789 | } | 791 | } |
790 | 792 | ||
diff --git a/src/lib/libcrypto/sha/asm/sha512-x86_64.pl b/src/lib/libcrypto/sha/asm/sha512-x86_64.pl index f611a2d898..8d51678557 100755 --- a/src/lib/libcrypto/sha/asm/sha512-x86_64.pl +++ b/src/lib/libcrypto/sha/asm/sha512-x86_64.pl | |||
@@ -51,7 +51,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; | |||
51 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or | 51 | ( $xlate="${dir}../../perlasm/x86_64-xlate.pl" and -f $xlate) or |
52 | die "can't locate x86_64-xlate.pl"; | 52 | die "can't locate x86_64-xlate.pl"; |
53 | 53 | ||
54 | open STDOUT,"| $^X $xlate $flavour $output"; | 54 | open OUT,"| \"$^X\" $xlate $flavour $output"; |
55 | *STDOUT=*OUT; | ||
55 | 56 | ||
56 | if ($output =~ /512/) { | 57 | if ($output =~ /512/) { |
57 | $func="sha512_block_data_order"; | 58 | $func="sha512_block_data_order"; |
diff --git a/src/lib/libcrypto/sha/sha256.c b/src/lib/libcrypto/sha/sha256.c index f88d3d6dad..4eae074849 100644 --- a/src/lib/libcrypto/sha/sha256.c +++ b/src/lib/libcrypto/sha/sha256.c | |||
@@ -88,17 +88,17 @@ int SHA224_Final (unsigned char *md, SHA256_CTX *c) | |||
88 | switch ((c)->md_len) \ | 88 | switch ((c)->md_len) \ |
89 | { case SHA224_DIGEST_LENGTH: \ | 89 | { case SHA224_DIGEST_LENGTH: \ |
90 | for (nn=0;nn<SHA224_DIGEST_LENGTH/4;nn++) \ | 90 | for (nn=0;nn<SHA224_DIGEST_LENGTH/4;nn++) \ |
91 | { ll=(c)->h[nn]; HOST_l2c(ll,(s)); } \ | 91 | { ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); } \ |
92 | break; \ | 92 | break; \ |
93 | case SHA256_DIGEST_LENGTH: \ | 93 | case SHA256_DIGEST_LENGTH: \ |
94 | for (nn=0;nn<SHA256_DIGEST_LENGTH/4;nn++) \ | 94 | for (nn=0;nn<SHA256_DIGEST_LENGTH/4;nn++) \ |
95 | { ll=(c)->h[nn]; HOST_l2c(ll,(s)); } \ | 95 | { ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); } \ |
96 | break; \ | 96 | break; \ |
97 | default: \ | 97 | default: \ |
98 | if ((c)->md_len > SHA256_DIGEST_LENGTH) \ | 98 | if ((c)->md_len > SHA256_DIGEST_LENGTH) \ |
99 | return 0; \ | 99 | return 0; \ |
100 | for (nn=0;nn<(c)->md_len/4;nn++) \ | 100 | for (nn=0;nn<(c)->md_len/4;nn++) \ |
101 | { ll=(c)->h[nn]; HOST_l2c(ll,(s)); } \ | 101 | { ll=(c)->h[nn]; (void)HOST_l2c(ll,(s)); } \ |
102 | break; \ | 102 | break; \ |
103 | } \ | 103 | } \ |
104 | } while (0) | 104 | } while (0) |