summaryrefslogtreecommitdiff
path: root/simon.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 /simon.cpp
parent6d9047b444731175e6ea9a447a3f0002685804be (diff)
downloadcryptopp-git-b74a6f444568e59a7766d1e286f82d2ce3086dcd.tar.gz
Add algorithm provider member function to Algorithm class
Diffstat (limited to 'simon.cpp')
-rw-r--r--simon.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/simon.cpp b/simon.cpp
index 2e26e7b9..3329a78e 100644
--- a/simon.cpp
+++ b/simon.cpp
@@ -225,6 +225,19 @@ extern size_t SIMON128_Dec_AdvancedProcessBlocks_SSSE3(const word64* subKeys, si
const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags);
#endif
+std::string SIMON64::Base::AlgorithmProvider() const
+{
+#if defined(CRYPTOPP_SSE41_AVAILABLE)
+ if (HasSSE41())
+ return "SSE4.1";
+#endif
+#if (CRYPTOPP_ARM_NEON_AVAILABLE)
+ if (HasNEON())
+ return "NEON";
+#endif
+ return "C++";
+}
+
void SIMON64::Base::UncheckedSetKey(const byte *userKey, unsigned int keyLength, const NameValuePairs &params)
{
CRYPTOPP_ASSERT(keyLength == 12 || keyLength == 16);
@@ -304,6 +317,19 @@ void SIMON64::Dec::ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock,
///////////////////////////////////////////////////////////
+std::string SIMON128::Base::AlgorithmProvider() const
+{
+#if defined(CRYPTOPP_SSSE3_AVAILABLE)
+ if (HasSSSE3())
+ return "SSSE3";
+#endif
+#if (CRYPTOPP_ARM_NEON_AVAILABLE)
+ if (HasNEON())
+ return "NEON";
+#endif
+ return "C++";
+}
+
void SIMON128::Base::UncheckedSetKey(const byte *userKey, unsigned int keyLength, const NameValuePairs &params)
{
CRYPTOPP_ASSERT(keyLength == 16 || keyLength == 24 || keyLength == 32);