summaryrefslogtreecommitdiffstats
path: root/crypto/openssl/crypto/sha
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2014-04-10 22:39:22 +0000
committerjkim <jkim@FreeBSD.org>2014-04-10 22:39:22 +0000
commitaeb5a4ff70fa036e3502afc9daf7d02795216340 (patch)
treec5b5657bc6509d897204957128bcbeac4535b4b7 /crypto/openssl/crypto/sha
parent8f4a94c1c91787a4ac5272d05fa061275e720a27 (diff)
downloadFreeBSD-src-aeb5a4ff70fa036e3502afc9daf7d02795216340.zip
FreeBSD-src-aeb5a4ff70fa036e3502afc9daf7d02795216340.tar.gz
MFC: r261037, r264278
Merge OpenSSL 1.0.1f and 1.0.1g.
Diffstat (limited to 'crypto/openssl/crypto/sha')
-rw-r--r--crypto/openssl/crypto/sha/Makefile4
-rwxr-xr-xcrypto/openssl/crypto/sha/asm/sha1-parisc.pl3
-rwxr-xr-xcrypto/openssl/crypto/sha/asm/sha1-x86_64.pl4
-rwxr-xr-xcrypto/openssl/crypto/sha/asm/sha512-mips.pl2
-rwxr-xr-xcrypto/openssl/crypto/sha/asm/sha512-parisc.pl2
-rw-r--r--crypto/openssl/crypto/sha/sha512.c9
6 files changed, 18 insertions, 6 deletions
diff --git a/crypto/openssl/crypto/sha/Makefile b/crypto/openssl/crypto/sha/Makefile
index 6d191d3..2eb2b7a 100644
--- a/crypto/openssl/crypto/sha/Makefile
+++ b/crypto/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/crypto/openssl/crypto/sha/asm/sha1-parisc.pl b/crypto/openssl/crypto/sha/asm/sha1-parisc.pl
index 6d7bf49..6e5a328 100755
--- a/crypto/openssl/crypto/sha/asm/sha1-parisc.pl
+++ b/crypto/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/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl b/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl
index cfdc45c..f15c7ec 100755
--- a/crypto/openssl/crypto/sha/asm/sha1-x86_64.pl
+++ b/crypto/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/crypto/openssl/crypto/sha/asm/sha512-mips.pl b/crypto/openssl/crypto/sha/asm/sha512-mips.pl
index ba5b250..ffa053b 100755
--- a/crypto/openssl/crypto/sha/asm/sha512-mips.pl
+++ b/crypto/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/crypto/openssl/crypto/sha/asm/sha512-parisc.pl b/crypto/openssl/crypto/sha/asm/sha512-parisc.pl
index e24ee58..fc0e15b 100755
--- a/crypto/openssl/crypto/sha/asm/sha512-parisc.pl
+++ b/crypto/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/crypto/openssl/crypto/sha/sha512.c b/crypto/openssl/crypto/sha/sha512.c
index 50dd7dc..50c229d 100644
--- a/crypto/openssl/crypto/sha/sha512.c
+++ b/crypto/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)
{
OpenPOWER on IntegriCloud