aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/block/threefish
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/block/threefish')
-rw-r--r--src/lib/block/threefish/threefish.cpp12
-rw-r--r--src/lib/block/threefish/threefish.h2
2 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/block/threefish/threefish.cpp b/src/lib/block/threefish/threefish.cpp
index 28a144fb6..99ce135d5 100644
--- a/src/lib/block/threefish/threefish.cpp
+++ b/src/lib/block/threefish/threefish.cpp
@@ -98,6 +98,18 @@ void Threefish_512::skein_feedfwd(const secure_vector<uint64_t>& M,
m_K[4] ^ m_K[5] ^ m_K[6] ^ m_K[7] ^ 0x1BD11BDAA9FC1A22;
}
+size_t Threefish_512::parallelism() const
+ {
+#if defined(BOTAN_HAS_THREEFISH_512_AVX2)
+ if(CPUID::has_avx2())
+ {
+ return 2;
+ }
+#endif
+
+ return 1;
+ }
+
std::string Threefish_512::provider() const
{
#if defined(BOTAN_HAS_THREEFISH_512_AVX2)
diff --git a/src/lib/block/threefish/threefish.h b/src/lib/block/threefish/threefish.h
index 8fe690f52..cdd27cb11 100644
--- a/src/lib/block/threefish/threefish.h
+++ b/src/lib/block/threefish/threefish.h
@@ -27,6 +27,8 @@ class BOTAN_DLL Threefish_512 final : public Block_Cipher_Fixed_Params<64, 64>
std::string provider() const override;
std::string name() const override { return "Threefish-512"; }
BlockCipher* clone() const override { return new Threefish_512; }
+ size_t parallelism() const override;
+
protected:
const secure_vector<uint64_t>& get_T() const { return m_T; }
const secure_vector<uint64_t>& get_K() const { return m_K; }