[openssl-commits] [openssl] master update

Andy Polyakov appro at openssl.org
Mon Apr 23 15:28:15 UTC 2018


The branch master has been updated
       via  40ab6b856754a11050174b222c7abb10b6dcb822 (commit)
       via  e9afe7a143a27e4e488e3d027439157fb0fc550b (commit)
       via  3571069526084778528b3099159689bbc485079b (commit)
       via  fe46035dbe173a42cbdfc7d31d17976300b22ccc (commit)
       via  eefc485bda4ab1ac7293b4c749c251b662d9fba8 (commit)
       via  1018a7251e1f8721fc7aebbe5737680544f71698 (commit)
       via  0fe72aaaa9bb01b440e6a285bffc1ffc2ea174ac (commit)
       via  e4739e31ee7430046e80b88132c2ccbc7ca501d9 (commit)
      from  dd2d7b19f8572b2c447397524621efdb675b5248 (commit)


- Log -----------------------------------------------------------------
commit 40ab6b856754a11050174b222c7abb10b6dcb822
Author: Andy Polyakov <appro at openssl.org>
Date:   Sun Apr 22 14:08:28 2018 +0200

    00-base-templates.conf: wire keccak1600-armv4 module.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/6042)

commit e9afe7a143a27e4e488e3d027439157fb0fc550b
Author: Andy Polyakov <appro at openssl.org>
Date:   Sun Apr 22 13:59:52 2018 +0200

    sha/asm/keccak1600-armv4.pl: adapt for multi-platform.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/6042)

commit 3571069526084778528b3099159689bbc485079b
Author: Andy Polyakov <appro at openssl.org>
Date:   Sun Apr 22 13:45:12 2018 +0200

    00-base-templates.conf: wire keccak1600-ppc64 module.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/6042)

commit fe46035dbe173a42cbdfc7d31d17976300b22ccc
Author: Andy Polyakov <appro at openssl.org>
Date:   Sun Apr 22 13:09:49 2018 +0200

    00-base-templates.conf: wire keccak1600-s390x module.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/6042)

commit eefc485bda4ab1ac7293b4c749c251b662d9fba8
Author: Andy Polyakov <appro at openssl.org>
Date:   Sun Apr 22 13:00:28 2018 +0200

    00-base-templates.conf: wire keccak1600-armv8 module.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/6042)

commit 1018a7251e1f8721fc7aebbe5737680544f71698
Author: Andy Polyakov <appro at openssl.org>
Date:   Sun Apr 22 12:56:31 2018 +0200

    00-base-templates.conf: wire keccak1600-x86_64 module.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/6042)

commit 0fe72aaaa9bb01b440e6a285bffc1ffc2ea174ac
Author: Andy Polyakov <appro at openssl.org>
Date:   Sun Apr 22 12:48:56 2018 +0200

    sha/asm/keccak1600-x86_64.pl: make it work on Windows.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/6042)

commit e4739e31ee7430046e80b88132c2ccbc7ca501d9
Author: Andy Polyakov <appro at openssl.org>
Date:   Sun Apr 22 10:42:59 2018 +0200

    Configure: add $target{keccak1600_asm_src}.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    (Merged from https://github.com/openssl/openssl/pull/6042)

-----------------------------------------------------------------------

Summary of changes:
 Configurations/00-base-templates.conf |  7 ++++++-
 Configure                             |  3 +++
 crypto/sha/asm/keccak1600-armv4.pl    | 23 ++++++++++++++++++++---
 crypto/sha/asm/keccak1600-x86_64.pl   |  8 ++++----
 crypto/sha/build.info                 |  8 +++++++-
 5 files changed, 40 insertions(+), 9 deletions(-)

diff --git a/Configurations/00-base-templates.conf b/Configurations/00-base-templates.conf
index edcc454..4a1645f 100644
--- a/Configurations/00-base-templates.conf
+++ b/Configurations/00-base-templates.conf
@@ -34,6 +34,7 @@ my %targets=(
 	padlock_asm_src	=> "",
 	chacha_asm_src	=> "chacha_enc.c",
 	poly1305_asm_src	=> "",
+	keccak1600_asm_src	=> "keccak1600.c",
 
 	unistd		=> "<unistd.h>",
 	shared_target	=> "",
@@ -226,6 +227,7 @@ my %targets=(
 	padlock_asm_src => "e_padlock-x86_64.s",
 	chacha_asm_src	=> "chacha-x86_64.s",
 	poly1305_asm_src=> "poly1305-x86_64.s",
+	keccak1600_asm_src	=> "keccak1600-x86_64.s",
     },
     ia64_asm => {
 	template	=> 1,
@@ -287,6 +289,7 @@ my %targets=(
 	modes_asm_src   => "ghash-s390x.S",
 	chacha_asm_src  => "chacha-s390x.S",
 	poly1305_asm_src=> "poly1305-s390x.S",
+	keccak1600_asm_src	=> "keccak1600-s390x.S",
     },
     armv4_asm => {
 	template	=> 1,
@@ -298,6 +301,7 @@ my %targets=(
 	modes_asm_src   => "ghash-armv4.S ghashv8-armx.S",
 	chacha_asm_src  => "chacha-armv4.S",
 	poly1305_asm_src=> "poly1305-armv4.S", 
+	keccak1600_asm_src	=> "keccak1600-armv4.S",
 	perlasm_scheme	=> "void"
     },
     aarch64_asm => {
@@ -310,6 +314,7 @@ my %targets=(
 	modes_asm_src   => "ghashv8-armx.S",
 	chacha_asm_src  => "chacha-armv8.S",
 	poly1305_asm_src=> "poly1305-armv8.S",
+	keccak1600_asm_src	=> "keccak1600-armv8.S",
     },
     parisc11_asm => {
 	template	=> 1,
@@ -340,6 +345,6 @@ my %targets=(
 	inherit_from	=> [ "ppc32_asm" ],
 	template	=> 1,
 	ec_asm_src	=> "ecp_nistz256.c ecp_nistz256-ppc64.s",
-
+	keccak1600_asm_src	=> "keccak1600-ppc64.s",
     },
 );
diff --git a/Configure b/Configure
index 5703302..ffc5fe5 100755
--- a/Configure
+++ b/Configure
@@ -1359,6 +1359,9 @@ unless ($disabled{asm}) {
 	push @{$config{lib_defines}}, "SHA256_ASM" if ($target{sha1_asm_src} =~ /sha256/);
 	push @{$config{lib_defines}}, "SHA512_ASM" if ($target{sha1_asm_src} =~ /sha512/);
     }
+    if ($target{keccak1600_asm_src} ne $table{DEFAULTS}->{keccak1600_asm_src}) {
+	push @{$config{lib_defines}}, "KECCAK1600_ASM";
+    }
     if ($target{rc4_asm_src} ne $table{DEFAULTS}->{rc4_asm_src}) {
 	push @{$config{lib_defines}}, "RC4_ASM";
     }
diff --git a/crypto/sha/asm/keccak1600-armv4.pl b/crypto/sha/asm/keccak1600-armv4.pl
index 4ef9ee0..8bf665c 100755
--- a/crypto/sha/asm/keccak1600-armv4.pl
+++ b/crypto/sha/asm/keccak1600-armv4.pl
@@ -70,6 +70,21 @@
 #	Cortex-Mx, x>=3. Otherwise, non-NEON results for NEON-capable
 #	processors are presented mostly for reference purposes.
 
+$flavour = shift;
+if ($flavour=~/\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
+else { while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {} }
+
+if ($flavour && $flavour ne "void") {
+    $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
+    ( $xlate="${dir}arm-xlate.pl" and -f $xlate ) or
+    ( $xlate="${dir}../../perlasm/arm-xlate.pl" and -f $xlate) or
+    die "can't locate arm-xlate.pl";
+
+    open STDOUT,"| \"$^X\" $xlate $flavour $output";
+} else {
+    open STDOUT,">$output";
+}
+
 my @C = map("r$_",(0..9));
 my @E = map("r$_",(10..12,14));
 
@@ -96,6 +111,8 @@ my @D = map(8*$_, (25..29));
 my @T = map([ 8*$_, 8*($_+1), 8*($_+2), 8*($_+3), 8*($_+4) ], (30,35,40,45,50));
 
 $code.=<<___;
+#include "arm_arch.h"
+
 .text
 
 #if defined(__thumb2__)
@@ -1044,6 +1061,7 @@ ___
 }
 
 $code.=<<___;
+#if __ARM_MAX_ARCH__>=7
 .fpu	neon
 
 .type	iotas64, %object
@@ -1545,6 +1563,7 @@ SHA3_squeeze_neon:
 .Lsqueeze_neon_done:
 	ldmia	sp!, {r4-r6,pc}
 .size	SHA3_squeeze_neon,.-SHA3_squeeze_neon
+#endif
 .asciz	"Keccak-1600 absorb and squeeze for ARMv4/NEON, CRYPTOGAMS by <appro\@openssl.org>"
 .align	2
 ___
@@ -1573,13 +1592,11 @@ ___
     }
 }
 
-$output=pop;
-open STDOUT,">$output";
-
 foreach (split($/,$code)) {
 	s/\`([^\`]*)\`/eval $1/ge;
 
 	s/^\s+(ldr|str)\.([lh])\s+(r[0-9]+),\s*(\[.*)/ldrd($1,$2,$3,$4)/ge or
+	s/\b(ror|ls[rl])\s+(r[0-9]+.*)#/mov	$2$1#/g or
 	s/\bret\b/bx	lr/g		or
 	s/\bbx\s+lr\b/.word\t0xe12fff1e/g;	# make it possible to compile with -march=armv4
 
diff --git a/crypto/sha/asm/keccak1600-x86_64.pl b/crypto/sha/asm/keccak1600-x86_64.pl
index 94c9c10..e24b575 100755
--- a/crypto/sha/asm/keccak1600-x86_64.pl
+++ b/crypto/sha/asm/keccak1600-x86_64.pl
@@ -81,7 +81,7 @@ my @rhotates = ([  0,  1, 62, 28, 27 ],
 $code.=<<___;
 .text
 
-.type	__KeccakF1600,\@function
+.type	__KeccakF1600,\@abi-omnipotent
 .align	32
 __KeccakF1600:
 	mov	$A[4][0](%rdi), at C[0]
@@ -345,7 +345,7 @@ $code.=<<___;
 .size	__KeccakF1600,.-__KeccakF1600
 
 .globl	KeccakF1600
-.type	KeccakF1600,\@function
+.type	KeccakF1600,\@abi-omnipotent
 .align	32
 KeccakF1600:
 .cfi_startproc
@@ -410,7 +410,7 @@ ___
      ($A_flat,$inp) = ("%r8","%r9");
 $code.=<<___;
 .globl	SHA3_absorb
-.type	SHA3_absorb,\@function
+.type	SHA3_absorb,\@function,4
 .align	32
 SHA3_absorb:
 .cfi_startproc
@@ -505,7 +505,7 @@ ___
 
 $code.=<<___;
 .globl	SHA3_squeeze
-.type	SHA3_squeeze,\@function
+.type	SHA3_squeeze,\@function,4
 .align	32
 SHA3_squeeze:
 .cfi_startproc
diff --git a/crypto/sha/build.info b/crypto/sha/build.info
index 9dffec3..5dd5a99 100644
--- a/crypto/sha/build.info
+++ b/crypto/sha/build.info
@@ -1,7 +1,7 @@
 LIBS=../../libcrypto
 SOURCE[../../libcrypto]=\
         sha1dgst.c sha1_one.c sha256.c sha512.c {- $target{sha1_asm_src} -} \
-        keccak1600.c
+        {- $target{keccak1600_asm_src} -}
 
 GENERATE[sha1-586.s]=asm/sha1-586.pl \
         $(PERLASM_SCHEME) $(LIB_CFLAGS) $(LIB_CPPFLAGS) $(PROCESSOR)
@@ -24,6 +24,7 @@ GENERATE[sha1-mb-x86_64.s]=asm/sha1-mb-x86_64.pl $(PERLASM_SCHEME)
 GENERATE[sha256-x86_64.s]=asm/sha512-x86_64.pl $(PERLASM_SCHEME)
 GENERATE[sha256-mb-x86_64.s]=asm/sha256-mb-x86_64.pl $(PERLASM_SCHEME)
 GENERATE[sha512-x86_64.s]=asm/sha512-x86_64.pl $(PERLASM_SCHEME)
+GENERATE[keccak1600-x86_64.s]=asm/keccak1600-x86_64.pl $(PERLASM_SCHEME)
 
 GENERATE[sha1-sparcv9.S]=asm/sha1-sparcv9.pl $(PERLASM_SCHEME)
 INCLUDE[sha1-sparcv9.o]=..
@@ -37,6 +38,7 @@ GENERATE[sha256-ppc.s]=asm/sha512-ppc.pl $(PERLASM_SCHEME)
 GENERATE[sha512-ppc.s]=asm/sha512-ppc.pl $(PERLASM_SCHEME)
 GENERATE[sha256p8-ppc.s]=asm/sha512p8-ppc.pl $(PERLASM_SCHEME)
 GENERATE[sha512p8-ppc.s]=asm/sha512p8-ppc.pl $(PERLASM_SCHEME)
+GENERATE[keccak1600-ppc64.s]=asm/keccak1600-ppc64.pl $(PERLASM_SCHEME)
 
 GENERATE[sha1-parisc.s]=asm/sha1-parisc.pl $(PERLASM_SCHEME)
 GENERATE[sha256-parisc.s]=asm/sha512-parisc.pl $(PERLASM_SCHEME)
@@ -55,6 +57,8 @@ GENERATE[sha256-armv4.S]=asm/sha256-armv4.pl $(PERLASM_SCHEME)
 INCLUDE[sha256-armv4.o]=..
 GENERATE[sha512-armv4.S]=asm/sha512-armv4.pl $(PERLASM_SCHEME)
 INCLUDE[sha512-armv4.o]=..
+GENERATE[keccak1600-armv4.S]=asm/keccak1600-armv4.pl $(PERLASM_SCHEME)
+INCLUDE[keccak1600-armv4.o]=..
 
 GENERATE[sha1-armv8.S]=asm/sha1-armv8.pl $(PERLASM_SCHEME)
 INCLUDE[sha1-armv8.o]=..
@@ -62,6 +66,7 @@ GENERATE[sha256-armv8.S]=asm/sha512-armv8.pl $(PERLASM_SCHEME)
 INCLUDE[sha256-armv8.o]=..
 GENERATE[sha512-armv8.S]=asm/sha512-armv8.pl $(PERLASM_SCHEME)
 INCLUDE[sha512-armv8.o]=..
+GENERATE[keccak1600-armv8.S]=asm/keccak1600-armv8.pl $(PERLASM_SCHEME)
 
 GENERATE[sha1-s390x.S]=asm/sha1-s390x.pl $(PERLASM_SCHEME)
 INCLUDE[sha1-s390x.o]=..
@@ -69,6 +74,7 @@ GENERATE[sha256-s390x.S]=asm/sha512-s390x.pl $(PERLASM_SCHEME)
 INCLUDE[sha256-s390x.o]=..
 GENERATE[sha512-s390x.S]=asm/sha512-s390x.pl $(PERLASM_SCHEME)
 INCLUDE[sha512-s390x.o]=..
+GENERATE[keccak1600-s390x.S]=asm/keccak1600-s390x.pl $(PERLASM_SCHEME)
 
 BEGINRAW[Makefile(unix)]
 ##### SHA assembler implementations


More information about the openssl-commits mailing list