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
This commit is contained in:
committed by
Andrew Turner
parent
41ccf82b29
commit
2708369395
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user