From 8df48e74987fb2ab3c97adb2b48c2cafc0ea381b Mon Sep 17 00:00:00 2001 From: Jack Lloyd Date: Sun, 27 May 2018 11:38:30 -0400 Subject: Add BMI2-specific SHA-256 Currently just a copy of the baseline compression function, but compiled with BMI2 flags. On Skylake improves performance by about 40%. --- src/lib/hash/sha2_32/sha2_32.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/lib/hash/sha2_32/sha2_32.h') diff --git a/src/lib/hash/sha2_32/sha2_32.h b/src/lib/hash/sha2_32/sha2_32.h index 6a0d87ac7..bc883f77a 100644 --- a/src/lib/hash/sha2_32/sha2_32.h +++ b/src/lib/hash/sha2_32/sha2_32.h @@ -66,6 +66,12 @@ class BOTAN_PUBLIC_API(2,0) SHA_256 final : public MDx_HashFunction size_t blocks); #endif +#if defined(BOTAN_HAS_SHA2_32_X86_BMI2) + static void compress_digest_x86_bmi2(secure_vector& digest, + const uint8_t input[], + size_t blocks); +#endif + #if defined(BOTAN_HAS_SHA2_32_X86) static void compress_digest_x86(secure_vector& digest, const uint8_t input[], -- cgit v1.2.3