The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=27083693955d563f836fd1b6b1bc4e1a249d3b6b
commit 27083693955d563f836fd1b6b1bc4e1a249d3b6b Author: Sarah Walker <[email protected]> AuthorDate: 2026-01-13 14:25:50 +0000 Commit: Andrew Turner <[email protected]> CommitDate: 2026-01-13 15:28:04 +0000 crypto: Update sha256 and sha512 ifuncs to use passed HWCAP flags Reviewed by: andrew Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D54600 --- sys/crypto/sha2/sha256c.c | 8 ++------ sys/crypto/sha2/sha512c.c | 9 ++------- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/sys/crypto/sha2/sha256c.c b/sys/crypto/sha2/sha256c.c index b7f7295c5c85..c7f9bbf119a5 100644 --- a/sys/crypto/sha2/sha256c.c +++ b/sys/crypto/sha2/sha256c.c @@ -206,12 +206,8 @@ SHA256_Transform_arm64(uint32_t * state, const unsigned char block[64]) DEFINE_UIFUNC(static, void, SHA256_Transform, (uint32_t * state, const unsigned char block[64])) { - u_long hwcap; - - if (elf_aux_info(AT_HWCAP, &hwcap, sizeof(hwcap)) == 0) { - if ((hwcap & HWCAP_SHA2) != 0) - return (SHA256_Transform_arm64); - } + if ((at_hwcap & HWCAP_SHA2) != 0) + return (SHA256_Transform_arm64); return (SHA256_Transform_c); } diff --git a/sys/crypto/sha2/sha512c.c b/sys/crypto/sha2/sha512c.c index 076cb30a1dfa..335dae08abb7 100644 --- a/sys/crypto/sha2/sha512c.c +++ b/sys/crypto/sha2/sha512c.c @@ -236,13 +236,8 @@ SHA512_Transform_arm64(uint64_t * state, DEFINE_UIFUNC(static, void, SHA512_Transform, (uint64_t * state, const unsigned char block[SHA512_BLOCK_LENGTH])) { - u_long hwcap; - - if (elf_aux_info(AT_HWCAP, &hwcap, sizeof(hwcap)) == 0) { - if ((hwcap & HWCAP_SHA512) != 0) { - return (SHA512_Transform_arm64); - } - } + if ((at_hwcap & HWCAP_SHA512) != 0) + return (SHA512_Transform_arm64); return (SHA512_Transform_c); }
