summaryrefslogtreecommitdiff
path: root/crypto/sha
diff options
context:
space:
mode:
authorPaul Sherwood <paul.sherwood@codethink.co.uk>2014-04-20 10:42:58 +0000
committerPaul Sherwood <paul.sherwood@codethink.co.uk>2014-04-20 10:42:58 +0000
commit19c7d1a8561ff0e7262b8bfa74721581734e68f9 (patch)
tree8d8670c28357b7fae75acc7e22ccf354b107cc0e /crypto/sha
parent2bee25a915c2ba40e58229788aabc97765426016 (diff)
parented9938171f80c7534f6eb52f75c2538bca462807 (diff)
downloadopenssl-new-19c7d1a8561ff0e7262b8bfa74721581734e68f9.tar.gz
Merge remote-tracking branch 'origin/baserock/OpenSSL_1_0_1g' into baserock/ps/proto-web-systembaserock/ps/proto-web-system
Diffstat (limited to 'crypto/sha')
-rw-r--r--crypto/sha/Makefile4
-rw-r--r--crypto/sha/asm/sha1-parisc.pl3
-rwxr-xr-xcrypto/sha/asm/sha1-x86_64.pl4
-rw-r--r--crypto/sha/asm/sha512-mips.pl2
-rwxr-xr-xcrypto/sha/asm/sha512-parisc.pl2
-rw-r--r--crypto/sha/sha512.c9
6 files changed, 18 insertions, 6 deletions
diff --git a/crypto/sha/Makefile b/crypto/sha/Makefile
index 6d191d3936..2eb2b7af99 100644
--- a/crypto/sha/Makefile
+++ b/crypto/sha/Makefile
@@ -60,7 +60,9 @@ sha256-armv4.S: asm/sha256-armv4.pl
$(PERL) $< $(PERLASM_SCHEME) $@
sha1-alpha.s: asm/sha1-alpha.pl
- $(PERL) $< | $(CC) -E - | tee $@ > /dev/null
+ (preproc=/tmp/$$$$.$@; trap "rm $$preproc" INT; \
+ $(PERL) asm/sha1-alpha.pl > $$preproc && \
+ $(CC) -E $$preproc > $@ && rm $$preproc)
# Solaris make has to be explicitly told
sha1-x86_64.s: asm/sha1-x86_64.pl; $(PERL) asm/sha1-x86_64.pl $(PERLASM_SCHEME) > $@
diff --git a/crypto/sha/asm/sha1-parisc.pl b/crypto/sha/asm/sha1-parisc.pl
index 6d7bf495b2..6e5a328a6f 100644
--- a/crypto/sha/asm/sha1-parisc.pl
+++ b/crypto/sha/asm/sha1-parisc.pl
@@ -254,6 +254,7 @@ $code.=<<___;
___
$code =~ s/\`([^\`]*)\`/eval $1/gem;
-$code =~ s/,\*/,/gm if ($SIZE_T==4);
+$code =~ s/,\*/,/gm if ($SIZE_T==4);
+$code =~ s/\bbv\b/bve/gm if ($SIZE_T==8);
print $code;
close STDOUT;
diff --git a/crypto/sha/asm/sha1-x86_64.pl b/crypto/sha/asm/sha1-x86_64.pl
index cfdc45cce6..f15c7ec39b 100755
--- a/crypto/sha/asm/sha1-x86_64.pl
+++ b/crypto/sha/asm/sha1-x86_64.pl
@@ -745,7 +745,7 @@ $code.=<<___;
mov %rdi,$ctx # reassigned argument
mov %rsi,$inp # reassigned argument
mov %rdx,$num # reassigned argument
- vzeroall
+ vzeroupper
shl \$6,$num
add $inp,$num
@@ -1038,7 +1038,7 @@ ___
&Xtail_avx(\&body_20_39);
$code.=<<___;
- vzeroall
+ vzeroupper
add 0($ctx),$A # update context
add 4($ctx),@T[0]
diff --git a/crypto/sha/asm/sha512-mips.pl b/crypto/sha/asm/sha512-mips.pl
index ba5b250890..ffa053bb7d 100644
--- a/crypto/sha/asm/sha512-mips.pl
+++ b/crypto/sha/asm/sha512-mips.pl
@@ -351,7 +351,7 @@ $code.=<<___;
$ST $G,6*$SZ($ctx)
$ST $H,7*$SZ($ctx)
- bnel $inp,@X[15],.Loop
+ bne $inp,@X[15],.Loop
$PTR_SUB $Ktbl,`($rounds-16)*$SZ` # rewind $Ktbl
$REG_L $ra,$FRAMESIZE-1*$SZREG($sp)
diff --git a/crypto/sha/asm/sha512-parisc.pl b/crypto/sha/asm/sha512-parisc.pl
index e24ee58ae9..fc0e15b3c0 100755
--- a/crypto/sha/asm/sha512-parisc.pl
+++ b/crypto/sha/asm/sha512-parisc.pl
@@ -785,6 +785,8 @@ foreach (split("\n",$code)) {
s/cmpb,\*/comb,/ if ($SIZE_T==4);
+ s/\bbv\b/bve/ if ($SIZE_T==8);
+
print $_,"\n";
}
diff --git a/crypto/sha/sha512.c b/crypto/sha/sha512.c
index 50dd7dc744..50c229ddeb 100644
--- a/crypto/sha/sha512.c
+++ b/crypto/sha/sha512.c
@@ -232,7 +232,14 @@ int SHA384_Update (SHA512_CTX *c, const void *data, size_t len)
{ return SHA512_Update (c,data,len); }
void SHA512_Transform (SHA512_CTX *c, const unsigned char *data)
-{ sha512_block_data_order (c,data,1); }
+ {
+#ifndef SHA512_BLOCK_CAN_MANAGE_UNALIGNED_DATA
+ if ((size_t)data%sizeof(c->u.d[0]) != 0)
+ memcpy(c->u.p,data,sizeof(c->u.p)),
+ data = c->u.p;
+#endif
+ sha512_block_data_order (c,data,1);
+ }
unsigned char *SHA384(const unsigned char *d, size_t n, unsigned char *md)
{