mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
icp: add SHA512 implementation using Intel SHA512 extensions
Generated from crypto/sha/asm/sha512-x86_64.pl in openssl/openssl@241d4826f8. Sponsored-by: TrueNAS Reviewed-by: Tony Hutter <hutter2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Attila Fülöp <attila@fueloep.org> Signed-off-by: Rob Norris <rob.norris@truenas.com> Closes #18233
This commit is contained in:
committed by
Brian Behlendorf
parent
3547a358fd
commit
09c27a14a3
@@ -22,6 +22,7 @@
|
||||
|
||||
/*
|
||||
* Copyright (c) 2022 Tino Reichardt <milky-zfs@mcmilk.de>
|
||||
* Copyright (c) 2026, TrueNAS.
|
||||
*/
|
||||
|
||||
#include <sys/simd.h>
|
||||
@@ -92,6 +93,20 @@ const sha512_ops_t sha512_avx2_impl = {
|
||||
};
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_SHA512EXT)
|
||||
static boolean_t sha2_have_sha512ext(void)
|
||||
{
|
||||
return (kfpu_allowed() && zfs_sha512ext_available());
|
||||
}
|
||||
|
||||
TF(zfs_sha512_transform_sha512ext, tf_sha512_sha512ext);
|
||||
const sha512_ops_t sha512_sha512ext_impl = {
|
||||
.is_supported = sha2_have_sha512ext,
|
||||
.transform = tf_sha512_sha512ext,
|
||||
.name = "sha512ext"
|
||||
};
|
||||
#endif
|
||||
|
||||
#elif defined(__aarch64__) || defined(__arm__)
|
||||
extern void zfs_sha512_block_armv7(uint64_t s[8], const void *, size_t);
|
||||
const sha512_ops_t sha512_armv7_impl = {
|
||||
@@ -164,6 +179,9 @@ static const sha512_ops_t *const sha512_impls[] = {
|
||||
#if defined(__x86_64) && defined(HAVE_AVX2)
|
||||
&sha512_avx2_impl,
|
||||
#endif
|
||||
#if defined(__x86_64) && defined(HAVE_SHA512EXT)
|
||||
&sha512_sha512ext_impl,
|
||||
#endif
|
||||
#if defined(__aarch64__) || defined(__arm__)
|
||||
&sha512_armv7_impl,
|
||||
#if defined(__aarch64__)
|
||||
|
||||
Reference in New Issue
Block a user