Update - OpenSSL 1.1.1-pre7-dev
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env perl
|
||||
# Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -538,13 +538,13 @@ $code.=<<___;
|
||||
.type KeccakF1600_ce,%function
|
||||
.align 5
|
||||
KeccakF1600_ce:
|
||||
mov x9,#6
|
||||
mov x9,#12
|
||||
adr x10,iotas
|
||||
b .Loop_ce
|
||||
.align 4
|
||||
.Loop_ce:
|
||||
___
|
||||
for($i=0; $i<4; $i++) {
|
||||
for($i=0; $i<2; $i++) {
|
||||
$code.=<<___;
|
||||
////////////////////////////////////////////////// Theta
|
||||
eor3 $C[0],$A[0][0],$A[1][0],$A[2][0]
|
||||
@@ -584,7 +584,7 @@ $code.=<<___;
|
||||
eor $A[0][0],$A[0][0],$C[4]
|
||||
ldr x11,[x10],#8
|
||||
|
||||
xar $C[1] ,$A[3][3],$C[2],#64-$rhotates[3][3] // C[1]=A[0][3]
|
||||
xar $C[1], $A[3][3],$C[2],#64-$rhotates[3][3] // C[1]=A[0][3]
|
||||
xar $A[3][3],$A[3][2],$C[6],#64-$rhotates[3][2]
|
||||
xar $A[3][2],$A[2][1],$C[5],#64-$rhotates[2][1]
|
||||
xar $A[2][1],$A[1][2],$C[6],#64-$rhotates[1][2]
|
||||
@@ -598,7 +598,7 @@ $code.=<<___;
|
||||
xar $A[1][3],$A[3][1],$C[5],#64-$rhotates[3][1]
|
||||
xar $A[3][1],$A[1][0],$C[4],#64-$rhotates[1][0]
|
||||
|
||||
xar $A[1][0],$A[0][3],$C[2],#64-$rhotates[0][3] // *
|
||||
xar $C[2], $A[0][3],$C[2],#64-$rhotates[0][3] // C[2]=A[1][0]
|
||||
|
||||
////////////////////////////////////////////////// Chi+Iota
|
||||
dup $C[6],x11 // borrow C[6]
|
||||
@@ -608,36 +608,36 @@ $code.=<<___;
|
||||
bcax $A[0][3],$C[1], $A[0][0],$A[0][4]
|
||||
bcax $A[0][4],$A[0][4],$C[0], $A[0][0]
|
||||
|
||||
bcax $C[0], $A[1][0],$A[1][2],$A[1][1] // *
|
||||
bcax $C[1], $A[1][1],$A[1][3],$A[1][2] // *
|
||||
bcax $A[1][0],$C[2], $A[1][2],$A[1][1] // *
|
||||
bcax $C[0], $A[1][1],$A[1][3],$A[1][2] // *
|
||||
bcax $A[1][2],$A[1][2],$A[1][4],$A[1][3]
|
||||
bcax $A[1][3],$A[1][3],$A[1][0],$A[1][4]
|
||||
bcax $A[1][4],$A[1][4],$A[1][1],$A[1][0]
|
||||
bcax $A[1][3],$A[1][3],$C[2], $A[1][4]
|
||||
bcax $A[1][4],$A[1][4],$A[1][1],$C[2]
|
||||
|
||||
eor $A[0][0],$C[3],$C[6] // Iota
|
||||
|
||||
bcax $C[2], $A[2][0],$A[2][2],$A[2][1] // *
|
||||
bcax $C[3], $A[2][1],$A[2][3],$A[2][2] // *
|
||||
bcax $C[1], $A[2][0],$A[2][2],$A[2][1] // *
|
||||
bcax $C[2], $A[2][1],$A[2][3],$A[2][2] // *
|
||||
bcax $A[2][2],$A[2][2],$A[2][4],$A[2][3]
|
||||
bcax $A[2][3],$A[2][3],$A[2][0],$A[2][4]
|
||||
bcax $A[2][4],$A[2][4],$A[2][1],$A[2][0]
|
||||
|
||||
bcax $A[2][0],$A[3][0],$A[3][2],$A[3][1] // *
|
||||
bcax $A[2][1],$A[3][1],$A[3][3],$A[3][2] // *
|
||||
bcax $C[3], $A[3][0],$A[3][2],$A[3][1] // *
|
||||
bcax $C[4], $A[3][1],$A[3][3],$A[3][2] // *
|
||||
bcax $A[3][2],$A[3][2],$A[3][4],$A[3][3]
|
||||
bcax $A[3][3],$A[3][3],$A[3][0],$A[3][4]
|
||||
bcax $A[3][4],$A[3][4],$A[3][1],$A[3][0]
|
||||
|
||||
bcax $A[3][0],$A[4][0],$A[4][2],$A[4][1] // *
|
||||
bcax $A[3][1],$A[4][1],$A[4][3],$A[4][2] // *
|
||||
bcax $C[5], $A[4][0],$A[4][2],$A[4][1] // *
|
||||
bcax $C[6], $A[4][1],$A[4][3],$A[4][2] // *
|
||||
bcax $A[4][2],$A[4][2],$A[4][4],$A[4][3]
|
||||
bcax $A[4][3],$A[4][3],$A[4][0],$A[4][4]
|
||||
bcax $A[4][4],$A[4][4],$A[4][1],$A[4][0]
|
||||
___
|
||||
($A[1][0],$A[1][1], $C[0],$C[1])
|
||||
= ($C[0],$C[1], $A[1][0],$A[1][1]);
|
||||
($A[2][0],$A[2][1], $A[3][0],$A[3][1], $A[4][0],$A[4][1], $C[2],$C[3])
|
||||
= ($C[2],$C[3], $A[2][0],$A[2][1], $A[3][0],$A[3][1], $A[4][0],$A[4][1]);
|
||||
( $A[1][1], $C[0]) = ( $C[0], $A[1][1]);
|
||||
($A[2][0],$A[2][1], $C[1],$C[2]) = ($C[1],$C[2], $A[2][0],$A[2][1]);
|
||||
($A[3][0],$A[3][1], $C[3],$C[4]) = ($C[3],$C[4], $A[3][0],$A[3][1]);
|
||||
($A[4][0],$A[4][1], $C[5],$C[6]) = ($C[5],$C[6], $A[4][0],$A[4][1]);
|
||||
}
|
||||
$code.=<<___;
|
||||
subs x9,x9,#1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env perl
|
||||
# Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env perl
|
||||
# Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env perl
|
||||
# Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env perl
|
||||
# Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
# PPC970/G5 14.6/+120%
|
||||
# POWER7 10.3/+100%
|
||||
# POWER8 11.5/+85%
|
||||
# POWER9 7.2/+45%
|
||||
#
|
||||
# (*) Corresponds to SHA3-256. Percentage after slash is improvement
|
||||
# over gcc-4.x-generated KECCAK_1X_ALT code. Newer compilers do
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env perl
|
||||
# Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
@@ -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),@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
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
# buffer for r=1088, which matches SHA3-256. This is 17% better than
|
||||
# scalar PPC64 code. It probably should be noted that if POWER8's
|
||||
# successor can achieve higher scalar instruction issue rate, then
|
||||
# this module will loose...
|
||||
# this module will loose... And it does on POWER9 with 8.8 vs. 7.2.
|
||||
|
||||
$flavour = shift;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2009-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright 2009-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
@@ -75,7 +75,7 @@ if ($flavour =~ /64|n32/i) {
|
||||
#
|
||||
######################################################################
|
||||
|
||||
$big_endian=(`echo MIPSEL | $ENV{CC} -E -`=~/MIPSEL/)?1:0 if ($ENV{CC});
|
||||
$big_endian=(`echo MIPSEB | $ENV{CC} -E -`=~/MIPSEB/)?0:1 if ($ENV{CC});
|
||||
|
||||
for (@ARGV) { $output=$_ if (/\w[\w\-]*\.\w+$/); }
|
||||
open STDOUT,">$output";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#! /usr/bin/env perl
|
||||
# Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright 2010-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
@@ -81,7 +81,7 @@ $pf = ($flavour =~ /nubi/i) ? $t0 : $t2;
|
||||
#
|
||||
######################################################################
|
||||
|
||||
$big_endian=(`echo MIPSEL | $ENV{CC} -E -`=~/MIPSEL/)?1:0 if ($ENV{CC});
|
||||
$big_endian=(`echo MIPSEB | $ENV{CC} -E -`=~/MIPSEB/)?0:1 if ($ENV{CC});
|
||||
|
||||
for (@ARGV) { $output=$_ if (/\w[\w\-]*\.\w+$/); }
|
||||
open STDOUT,">$output";
|
||||
|
||||
@@ -36,9 +36,9 @@
|
||||
# little-endian system]. Numbers in square brackets are for 64-bit
|
||||
# build of sha512-ppc.pl, presented for reference.
|
||||
#
|
||||
# POWER8
|
||||
# SHA256 9.9 [15.8]
|
||||
# SHA512 6.3 [10.3]
|
||||
# POWER8 POWER9
|
||||
# SHA256 9.9 [15.8] 9.2 [9.3]
|
||||
# SHA512 6.3 [10.3] 5.8 [5.9]
|
||||
|
||||
$flavour=shift;
|
||||
$output =shift;
|
||||
|
||||
Reference in New Issue
Block a user