Files
linux/lib
Eric Biggers 862445d3b9 lib/crypto: s390/sha3: Add optimized one-shot SHA-3 digest functions
Some z/Architecture processors can compute a SHA-3 digest in a single
instruction.  arch/s390/crypto/ already uses this capability to optimize
the SHA-3 crypto_shash algorithms.

Use this capability to implement the sha3_224(), sha3_256(), sha3_384(),
and sha3_512() library functions too.

SHA3-256 benchmark results provided by Harald Freudenberger
(https://lore.kernel.org/r/4188d18bfcc8a64941c5ebd8de10ede2@linux.ibm.com/)
on a z/Architecture machine with "facility 86" (MSA level 12):

    Length (bytes)    Before (MB/s)   After (MB/s)
    ==============    =============   ============
          16                212             225
          64                820             915
         256               1850            3350
        1024               5400            8300
        4096              11200           11300

Note: the original data from Harald was given in the form of a graph for
each length, showing the distribution of throughputs from 500 runs.  I
guesstimated the peak of each one.

Harald also reported that the generic SHA-3 code was at most 259 MB/s
(https://lore.kernel.org/r/c39f6b6c110def0095e5da5becc12085@linux.ibm.com/).
So as expected, the earlier commit that optimized sha3_absorb_blocks()
and sha3_keccakf() is the more important one; it optimized the Keccak
permutation which is the most performance-critical part of SHA-3.
Still, this additional commit does notably improve performance further
on some lengths.

Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Tested-by: Harald Freudenberger <freude@linux.ibm.com>
Link: https://lore.kernel.org/r/20251026055032.1413733-13-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
2025-11-05 20:30:41 -08:00
..
2024-12-12 18:26:32 +01:00
2025-03-16 22:30:49 -07:00
2025-04-11 17:32:38 -07:00
2025-04-11 17:32:37 -07:00
2024-07-12 16:39:53 -07:00
2024-02-01 13:06:40 +01:00
2023-02-02 22:50:01 -08:00
2023-02-02 22:50:01 -08:00
2025-07-08 19:11:57 -04:00
2025-03-25 10:18:31 -03:00
2025-01-12 20:21:15 -08:00
2025-01-14 19:45:35 +01:00
2024-10-14 16:33:24 -05:00
2023-10-16 12:44:06 -04:00
2022-10-03 17:34:32 -07:00
2025-03-17 12:17:00 -07:00
2025-05-11 17:54:04 -07:00
2024-02-15 12:17:28 -05:00
2025-03-25 10:18:31 -03:00
2024-12-09 13:48:29 -08:00
2025-09-13 16:54:46 -07:00
2025-08-02 12:01:37 -07:00