summaryrefslogtreecommitdiff
path: root/simon.cpp
diff options
context:
space:
mode:
authorJeffrey Walton <noloader@gmail.com>2018-08-14 07:14:39 -0400
committerJeffrey Walton <noloader@gmail.com>2018-08-14 07:14:39 -0400
commit9b91b94b05929277db2dc8dd2d5185adcba98bed (patch)
tree08526a272e51cf2f3e4cabc41d1e84c886ce9902 /simon.cpp
parentd8c28bdc2bd23ee7c25fd60c306d31a1ad61a2cb (diff)
downloadcryptopp-git-9b91b94b05929277db2dc8dd2d5185adcba98bed.tar.gz
Add POWER8 SIMON-64 implementation
Diffstat (limited to 'simon.cpp')
-rw-r--r--simon.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/simon.cpp b/simon.cpp
index 2f306933..d6c3480c 100644
--- a/simon.cpp
+++ b/simon.cpp
@@ -226,6 +226,12 @@ extern size_t SIMON128_Dec_AdvancedProcessBlocks_SSSE3(const word64* subKeys, si
#endif
#if (CRYPTOPP_POWER8_AVAILABLE)
+extern size_t SIMON64_Enc_AdvancedProcessBlocks_POWER8(const word32* subKeys, size_t rounds,
+ const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags);
+
+extern size_t SIMON64_Dec_AdvancedProcessBlocks_POWER8(const word32* subKeys, size_t rounds,
+ const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags);
+
extern size_t SIMON128_Enc_AdvancedProcessBlocks_POWER8(const word64* subKeys, size_t rounds,
const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags);
@@ -243,6 +249,10 @@ std::string SIMON64::Base::AlgorithmProvider() const
if (HasNEON())
return "NEON";
#endif
+#if (CRYPTOPP_POWER8_AVAILABLE)
+ if (HasPower8())
+ return "Power8";
+#endif
return "C++";
}
@@ -444,6 +454,11 @@ size_t SIMON64::Enc::AdvancedProcessBlocks(const byte *inBlocks, const byte *xor
return SIMON64_Enc_AdvancedProcessBlocks_NEON(m_rkeys, (size_t)m_rounds,
inBlocks, xorBlocks, outBlocks, length, flags);
#endif
+#if (CRYPTOPP_POWER8_AVAILABLE)
+ if (HasPower8())
+ return SIMON64_Enc_AdvancedProcessBlocks_POWER8(m_rkeys, (size_t)m_rounds,
+ inBlocks, xorBlocks, outBlocks, length, flags);
+#endif
return BlockTransformation::AdvancedProcessBlocks(inBlocks, xorBlocks, outBlocks, length, flags);
}
@@ -460,6 +475,11 @@ size_t SIMON64::Dec::AdvancedProcessBlocks(const byte *inBlocks, const byte *xor
return SIMON64_Dec_AdvancedProcessBlocks_NEON(m_rkeys, (size_t)m_rounds,
inBlocks, xorBlocks, outBlocks, length, flags);
#endif
+#if (CRYPTOPP_POWER8_AVAILABLE)
+ if (HasPower8())
+ return SIMON64_Dec_AdvancedProcessBlocks_POWER8(m_rkeys, (size_t)m_rounds,
+ inBlocks, xorBlocks, outBlocks, length, flags);
+#endif
return BlockTransformation::AdvancedProcessBlocks(inBlocks, xorBlocks, outBlocks, length, flags);
}
#endif // CRYPTOPP_SIMON64_ADVANCED_PROCESS_BLOCKS