aboutsummaryrefslogtreecommitdiff
path: root/openssl/crypto/sha
diff options
context:
space:
mode:
Diffstat (limited to 'openssl/crypto/sha')
-rw-r--r--openssl/crypto/sha/Makefile4
-rw-r--r--openssl/crypto/sha/asm/sha1-parisc.pl3
-rw-r--r--openssl/crypto/sha/asm/sha1-x86_64.pl4
-rw-r--r--openssl/crypto/sha/asm/sha512-mips.pl2
-rw-r--r--openssl/crypto/sha/asm/sha512-parisc.pl2
-rw-r--r--openssl/crypto/sha/sha512.c9
6 files changed, 18 insertions, 6 deletions
diff --git a/openssl/crypto/sha/Makefile b/openssl/crypto/sha/Makefile
index 6d191d393..2eb2b7af9 100644
--- a/openssl/crypto/sha/Makefile
+++ b/openssl/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/openssl/crypto/sha/asm/sha1-parisc.pl b/openssl/crypto/sha/asm/sha1-parisc.pl
index 6d7bf495b..6e5a328a6 100644
--- a/openssl/crypto/sha/asm/sha1-parisc.pl
+++ b/openssl/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/openssl/crypto/sha/asm/sha1-x86_64.pl b/openssl/crypto/sha/asm/sha1-x86_64.pl
index cfdc45cce..f15c7ec39 100644
--- a/openssl/crypto/sha/asm/sha1-x86_64.pl
+++ b/openssl/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/openssl/crypto/sha/asm/sha512-mips.pl b/openssl/crypto/sha/asm/sha512-mips.pl
index ba5b25089..ffa053bb7 100644
--- a/openssl/crypto/sha/asm/sha512-mips.pl
+++ b/openssl/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/openssl/crypto/sha/asm/sha512-parisc.pl b/openssl/crypto/sha/asm/sha512-parisc.pl
index e24ee58ae..fc0e15b3c 100644
--- a/openssl/crypto/sha/asm/sha512-parisc.pl
+++ b/openssl/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/openssl/crypto/sha/sha512.c b/openssl/crypto/sha/sha512.c
index 50dd7dc74..50c229dde 100644
--- a/openssl/crypto/sha/sha512.c
+++ b/openssl/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)
{