summaryrefslogtreecommitdiff
path: root/blake2.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-07-06 09:23:37 -0400
committerGitHub <noreply@github.com>2018-07-06 09:23:37 -0400
commitb74a6f444568e59a7766d1e286f82d2ce3086dcd (patch)
tree97937fe23f742f6c352f39e206b7ce7d774ba358 /blake2.cpp
parent6d9047b444731175e6ea9a447a3f0002685804be (diff)
downloadcryptopp-git-b74a6f444568e59a7766d1e286f82d2ce3086dcd.tar.gz
Add algorithm provider member function to Algorithm class
Diffstat (limited to 'blake2.cpp')
-rw-r--r--blake2.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/blake2.cpp b/blake2.cpp
index 1af13fdb..eb7fc726 100644
--- a/blake2.cpp
+++ b/blake2.cpp
@@ -284,6 +284,25 @@ void BLAKE2_Base<W, T_64bit>::UncheckedSetKey(const byte *key, unsigned int leng
}
}
+std::string BLAKE2_Base_AlgorithmProvider()
+{
+#if defined(CRYPTOPP_SSE41_AVAILABLE)
+ if (HasSSE41())
+ return "SSE4.1";
+#endif
+#if (CRYPTOPP_ARM_NEON_AVAILABLE)
+ if (HasNEON())
+ return "NEON";
+#endif
+ return "C++";
+}
+
+template <class W, bool T_64bit>
+std::string BLAKE2_Base<W, T_64bit>::AlgorithmProvider() const
+{
+ return BLAKE2_Base_AlgorithmProvider();
+}
+
template <class W, bool T_64bit>
BLAKE2_Base<W, T_64bit>::BLAKE2_Base() : m_state(1), m_block(1), m_digestSize(DIGESTSIZE), m_treeMode(false)
{