diff options
author | Andy Polyakov <appro@openssl.org> | 2010-10-02 12:43:04 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2010-10-02 12:43:04 +0000 |
commit | 5ad83922cae0685454a8081a3c6a5b64a1d828c3 (patch) | |
tree | 5e4f0705bfa45f31dfdaf1c5bf6430216bcf3fc9 /crypto/sha/asm | |
parent | d4665887886274483a64f3ac167c81b0d7ef88af (diff) |
sha512-mips.pl: add missing byte swap for little-endians.
Diffstat (limited to 'crypto/sha/asm')
-rw-r--r-- | crypto/sha/asm/sha512-mips.pl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/sha/asm/sha512-mips.pl b/crypto/sha/asm/sha512-mips.pl index 41f4e7fbfb..2c70663f98 100644 --- a/crypto/sha/asm/sha512-mips.pl +++ b/crypto/sha/asm/sha512-mips.pl @@ -67,8 +67,13 @@ if ($flavour =~ /64|n32/i) { ###################################################################### $output=shift; +for (@ARGV) { $big_endian=1 if (/\-DB_ENDIAN/); + $big_endian=0 if (/\-DL_ENDIAN/); + $output=$_ if (/^\w[\w\-]*\.\w+$/); } open STDOUT,">$output"; +if (!defined($big_endian)) { $big_endian=(unpack('L',pack('N',1))==1); } + if ($output =~ /512/) { $label="512"; $SZ=8; @@ -114,7 +119,7 @@ $code.=<<___ if ($i<15); ${LD}l @X[1],`($i+1)*$SZ+$MSB`($inp) ${LD}r @X[1],`($i+1)*$SZ+$LSB`($inp) ___ -$code.=<<___ if ($little_endian && $i<16); # XXX no 64-bit byte swap yet +$code.=<<___ if (!$big_endian && $i<16); # XXX no 64-bit byte swap yet srl $tmp0,@X[0],24 # byte swap($i) srl $tmp1,@X[0],8 andi $tmp2,@X[0],0xFF00 |