aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/hash/sha2_32/sha2_32.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/hash/sha2_32/sha2_32.h')
-rw-r--r--src/lib/hash/sha2_32/sha2_32.h27
1 files changed, 20 insertions, 7 deletions
diff --git a/src/lib/hash/sha2_32/sha2_32.h b/src/lib/hash/sha2_32/sha2_32.h
index 5a687efbe..ecf2e0ece 100644
--- a/src/lib/hash/sha2_32/sha2_32.h
+++ b/src/lib/hash/sha2_32/sha2_32.h
@@ -49,20 +49,33 @@ class BOTAN_DLL SHA_256 final : public MDx_HashFunction
SHA_256() : MDx_HashFunction(64, true, true), m_digest(8)
{ clear(); }
+ /*
+ * Perform a SHA-256 compression. For internal use
+ */
+ static void compress_digest(secure_vector<uint32_t>& digest,
+ const uint8_t input[],
+ size_t blocks);
+
private:
+
+#if defined(BOTAN_HAS_SHA2_32_ARMV8)
+ static void compress_digest_armv8(secure_vector<uint32_t>& digest,
+ const uint8_t input[],
+ size_t blocks);
+#endif
+
+#if defined(BOTAN_HAS_SHA2_32_X86)
+ static void compress_digest_x86(secure_vector<uint32_t>& digest,
+ const uint8_t input[],
+ size_t blocks);
+#endif
+
void compress_n(const uint8_t[], size_t blocks) override;
void copy_out(uint8_t[]) override;
secure_vector<uint32_t> m_digest;
};
-#if defined(BOTAN_HAS_SHA2_32_X86)
-/*
-* SHA-256 compression using Goldmont x86 extensions. Not for public consumption.
-*/
-void sha2_compress_x86(uint32_t digest[8], const uint8_t input[], size_t blocks);
-#endif
-
}
#endif