Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/crypto/external/bsd/openssl/dist/crypto Revert the condition...
details: https://anonhg.NetBSD.org/src/rev/284eb6626938
branches: trunk
changeset: 935030:284eb6626938
user: christos <christos%NetBSD.org@localhost>
date: Mon Jun 22 16:25:08 2020 +0000
description:
Revert the conditional use of vsx on keccak. Upstream wants to disable it
instead (dot-asm:
So that both assembly modules export SHA3_absorb_vsx... Either way,
it makes lesser sense to deploy vector keccak1600p8-ppc.pl, because
benefits are not that clear. It's only nominally faster than scalar
module on POWER8 but significantly slower on POWER9. Because POWER9
is better equipped to handle non-vector code. On related note,
there is version optimized for little-endian, as well as 32-bit
version. [And since MIPS was mentioned, there is even MIPS module...]
diffstat:
crypto/external/bsd/openssl/dist/crypto/ppccap.c | 31 ----------
crypto/external/bsd/openssl/dist/crypto/sha/asm/keccak1600-ppc64.pl | 16 ++--
crypto/external/bsd/openssl/dist/crypto/sha/asm/keccak1600p8-ppc.pl | 16 ++--
crypto/external/bsd/openssl/dist/crypto/sha/keccak1600.c | 6 -
4 files changed, 16 insertions(+), 53 deletions(-)
diffs (151 lines):
diff -r 79f008a32199 -r 284eb6626938 crypto/external/bsd/openssl/dist/crypto/ppccap.c
--- a/crypto/external/bsd/openssl/dist/crypto/ppccap.c Mon Jun 22 16:21:29 2020 +0000
+++ b/crypto/external/bsd/openssl/dist/crypto/ppccap.c Mon Jun 22 16:25:08 2020 +0000
@@ -160,37 +160,6 @@
}
#endif
-size_t SHA3_absorb(uint64_t A[5][5], const unsigned char *inp, size_t len,
- size_t r);
-void SHA3_squeeze(uint64_t A[5][5], unsigned char *out, size_t len, size_t r);
-
-size_t SHA3_absorb_default(uint64_t A[5][5], const unsigned char *inp,
- size_t len, size_t r);
-void SHA3_squeeze_default(uint64_t A[5][5], unsigned char *out, size_t len,
- size_t r);
-
-size_t SHA3_absorb_vsx(uint64_t A[5][5], const unsigned char *inp,
- size_t len, size_t r);
-void SHA3_squeeze_vsx(uint64_t A[5][5], unsigned char *out, size_t len,
- size_t r);
-
-size_t SHA3_absorb(uint64_t A[5][5], const unsigned char *inp, size_t len,
- size_t r)
-{
- return OPENSSL_ppccap_P & PPC_CRYPTO207
- ? SHA3_absorb_vsx(A, inp, len, r)
- : SHA3_absorb_default(A, inp, len, r);
-}
-
-void SHA3_squeeze(uint64_t A[5][5], unsigned char *out, size_t len, size_t r)
-{
- OPENSSL_ppccap_P & PPC_CRYPTO207
- ? SHA3_squeeze_vsx(A, out, len, r)
- : SHA3_squeeze_default(A, out, len, r);
-}
-
-
-
static sigjmp_buf ill_jmp;
static void ill_handler(int sig)
{
diff -r 79f008a32199 -r 284eb6626938 crypto/external/bsd/openssl/dist/crypto/sha/asm/keccak1600-ppc64.pl
--- a/crypto/external/bsd/openssl/dist/crypto/sha/asm/keccak1600-ppc64.pl Mon Jun 22 16:21:29 2020 +0000
+++ b/crypto/external/bsd/openssl/dist/crypto/sha/asm/keccak1600-ppc64.pl Mon Jun 22 16:25:08 2020 +0000
@@ -405,10 +405,10 @@
.long 0
.size dword_le_load,.-dword_le_load
-.globl SHA3_absorb_vsx
-.type SHA3_absorb_vsx,\@function
+.globl SHA3_absorb
+.type SHA3_absorb,\@function
.align 5
-SHA3_absorb_vsx:
+SHA3_absorb:
$STU $sp,-$FRAME($sp)
mflr r0
$PUSH r14,`$FRAME-$SIZE_T*18`($sp)
@@ -627,15 +627,15 @@
.long 0
.byte 0,12,4,1,0x80,18,4,0
.long 0
-.size SHA3_absorb_vsx,.-SHA3_absorb_vsx
+.size SHA3_absorb,.-SHA3_absorb
___
{
my ($A_flat,$out,$len,$bsz) = map("r$_",(28..31));
$code.=<<___;
-.globl SHA3_squeeze_vsx
-.type SHA3_squeeze_vsx,\@function
+.globl SHA3_squeeze
+.type SHA3_squeeze,\@function
.align 5
-SHA3_squeeze_vsx:
+SHA3_squeeze:
$STU $sp,`-10*$SIZE_T`($sp)
mflr r0
$PUSH r28,`6*$SIZE_T`($sp)
@@ -705,7 +705,7 @@
.long 0
.byte 0,12,4,1,0x80,4,4,0
.long 0
-.size SHA3_squeeze_vsx,.-SHA3_squeeze_vsx
+.size SHA3_squeeze,.-SHA3_squeeze
___
}
diff -r 79f008a32199 -r 284eb6626938 crypto/external/bsd/openssl/dist/crypto/sha/asm/keccak1600p8-ppc.pl
--- a/crypto/external/bsd/openssl/dist/crypto/sha/asm/keccak1600p8-ppc.pl Mon Jun 22 16:21:29 2020 +0000
+++ b/crypto/external/bsd/openssl/dist/crypto/sha/asm/keccak1600p8-ppc.pl Mon Jun 22 16:25:08 2020 +0000
@@ -374,10 +374,10 @@
my ($A_jagged,$inp,$len,$bsz) = map("r$_",(3..6));
$code.=<<___;
-.globl SHA3_absorb_vsx
-.type SHA3_absorb_vsx,\@function
+.globl SHA3_absorb
+.type SHA3_absorb,\@function
.align 5
-SHA3_absorb_vsx:
+SHA3_absorb:
$STU $sp,-$FRAME($sp)
li r10,`15+6*$SIZE_T`
li r11,`31+6*$SIZE_T`
@@ -674,17 +674,17 @@
.long 0
.byte 0,12,0x04,1,0x80,0,4,0
.long 0
-.size SHA3_absorb_vsx,.-SHA3_absorb_vsx
+.size SHA3_absorb,.-SHA3_absorb
___
}
{
my ($A_jagged,$out,$len,$bsz) = map("r$_",(3..6));
$code.=<<___;
-.globl SHA3_squeeze_vsx
-.type SHA3_squeeze_vsx,\@function
+.globl SHA3_squeeze
+.type SHA3_squeeze,\@function
.align 5
-SHA3_squeeze_vsx:
+SHA3_squeeze:
mflr r9 ; r9 is not touched by KeccakF1600
subi $out,$out,1 ; prepare for stbu
addi r8,$A_jagged,4 ; prepare volatiles
@@ -770,7 +770,7 @@
.long 0
.byte 0,12,0x14,0,0,0,4,0
.long 0
-.size SHA3_squeeze_vsx,.-SHA3_squeeze_vsx
+.size SHA3_squeeze,.-SHA3_squeeze
___
}
$code.=<<___;
diff -r 79f008a32199 -r 284eb6626938 crypto/external/bsd/openssl/dist/crypto/sha/keccak1600.c
--- a/crypto/external/bsd/openssl/dist/crypto/sha/keccak1600.c Mon Jun 22 16:21:29 2020 +0000
+++ b/crypto/external/bsd/openssl/dist/crypto/sha/keccak1600.c Mon Jun 22 16:25:08 2020 +0000
@@ -11,12 +11,6 @@
#include <string.h>
#include <assert.h>
-#ifdef __powerpc__
-#define SHA3_absorb SHA3_absorb_default
-#define SHA3_squeeze SHA3_squeeze_default
-#undef KECCAK1600_ASM
-#endif
-
size_t SHA3_absorb(uint64_t A[5][5], const unsigned char *inp, size_t len,
size_t r);
void SHA3_squeeze(uint64_t A[5][5], unsigned char *out, size_t len, size_t r);
Home |
Main Index |
Thread Index |
Old Index