diff options
Diffstat (limited to 'src/crypto/fipsmodule/sha/sha512.c')
-rw-r--r-- | src/crypto/fipsmodule/sha/sha512.c | 37 |
1 files changed, 5 insertions, 32 deletions
diff --git a/src/crypto/fipsmodule/sha/sha512.c b/src/crypto/fipsmodule/sha/sha512.c index d31ab719..2c7ce314 100644 --- a/src/crypto/fipsmodule/sha/sha512.c +++ b/src/crypto/fipsmodule/sha/sha512.c @@ -279,9 +279,7 @@ static int sha512_final_impl(uint8_t *out, size_t md_len, SHA512_CTX *sha) { return 1; } -#if !defined(SHA512_ASM) - -#if !defined(SHA512_ASM_NOHW) +#ifndef SHA512_ASM static const uint64_t K512[80] = { UINT64_C(0x428a2f98d728ae22), UINT64_C(0x7137449123ef65cd), UINT64_C(0xb5c0fbcfec4d3b2f), UINT64_C(0xe9b5dba58189dbbc), @@ -343,8 +341,8 @@ static const uint64_t K512[80] = { #if defined(__i386) || defined(__i386__) || defined(_M_IX86) // This code should give better results on 32-bit CPU with less than // ~24 registers, both size and performance wise... -static void sha512_block_data_order_nohw(uint64_t *state, const uint8_t *in, - size_t num) { +static void sha512_block_data_order(uint64_t *state, const uint8_t *in, + size_t num) { uint64_t A, E, T; uint64_t X[9 + 80], *F; int i; @@ -416,8 +414,8 @@ static void sha512_block_data_order_nohw(uint64_t *state, const uint8_t *in, ROUND_00_15(i + j, a, b, c, d, e, f, g, h); \ } while (0) -static void sha512_block_data_order_nohw(uint64_t *state, const uint8_t *in, - size_t num) { +static void sha512_block_data_order(uint64_t *state, const uint8_t *in, + size_t num) { uint64_t a, b, c, d, e, f, g, h, s0, s1, T1; uint64_t X[16]; int i; @@ -500,31 +498,6 @@ static void sha512_block_data_order_nohw(uint64_t *state, const uint8_t *in, #endif -#endif // !SHA512_ASM_NOHW - -static void sha512_block_data_order(uint64_t *state, const uint8_t *data, - size_t num) { -#if defined(SHA512_ASM_HW) - if (sha512_hw_capable()) { - sha512_block_data_order_hw(state, data, num); - return; - } -#endif -#if defined(SHA512_ASM_AVX) - if (sha512_avx_capable()) { - sha512_block_data_order_avx(state, data, num); - return; - } -#endif -#if defined(SHA512_ASM_NEON) - if (CRYPTO_is_NEON_capable()) { - sha512_block_data_order_neon(state, data, num); - return; - } -#endif - sha512_block_data_order_nohw(state, data, num); -} - #endif // !SHA512_ASM #undef Sigma0 |