summaryrefslogtreecommitdiff
path: root/fat-s390x.c
diff options
context:
space:
mode:
authorMamone Tarsha <maamoun.tk@googlemail.com>2021-10-21 11:25:26 +0200
committerMamone Tarsha <maamoun.tk@googlemail.com>2021-10-21 11:25:26 +0200
commit806d6f6aacdf8b833476e9b55d56a93bb05514b3 (patch)
tree6865ded030fbc6f104c12c91bb1a22ce4286f46e /fat-s390x.c
parent78f44318c361e5d2f997ddcedfde35deeb648316 (diff)
downloadnettle-806d6f6aacdf8b833476e9b55d56a93bb05514b3.tar.gz
[S390x] Optimize SHA3 permute using vector facility
Diffstat (limited to 'fat-s390x.c')
-rw-r--r--fat-s390x.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/fat-s390x.c b/fat-s390x.c
index 2e4fdec5..db793e2c 100644
--- a/fat-s390x.c
+++ b/fat-s390x.c
@@ -264,6 +264,10 @@ DECLARE_FAT_FUNC(_nettle_sha512_compress, sha512_compress_func)
DECLARE_FAT_FUNC_VAR(sha512_compress, sha512_compress_func, c)
DECLARE_FAT_FUNC_VAR(sha512_compress, sha512_compress_func, s390x)
+DECLARE_FAT_FUNC(nettle_sha3_permute, sha3_permute_func)
+DECLARE_FAT_FUNC_VAR(sha3_permute, sha3_permute_func, c)
+DECLARE_FAT_FUNC_VAR(sha3_permute, sha3_permute_func, s390x)
+
static void CONSTRUCTOR
fat_init (void)
{
@@ -279,10 +283,16 @@ fat_init (void)
if (verbose)
fprintf (stderr, "libnettle: enabling vectorized memxor3.\n");
nettle_memxor3_vec = _nettle_memxor3_s390x;
+
+ if (verbose)
+ fprintf (stderr, "libnettle: enabling vectorized sha3 permute.\n");
+ nettle_sha3_permute_vec = _nettle_sha3_permute_s390x;
}
else
{
- nettle_memxor3_vec = _nettle_memxor3_c;
+ nettle_memxor3_vec = _nettle_memxor3_c;
+
+ nettle_sha3_permute_vec = _nettle_sha3_permute_c;
}
/* AES128 */
@@ -483,3 +493,7 @@ DEFINE_FAT_FUNC(_nettle_sha256_compress, void,
DEFINE_FAT_FUNC(_nettle_sha512_compress, void,
(uint64_t *state, const uint8_t *input, const uint64_t *k),
(state, input, k))
+
+/* SHA3 */
+DEFINE_FAT_FUNC(nettle_sha3_permute, void,
+ (struct sha3_state *state), (state))