diff options
author | Jeffrey Walton <noloader@gmail.com> | 2018-07-06 09:23:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-06 09:23:37 -0400 |
commit | b74a6f444568e59a7766d1e286f82d2ce3086dcd (patch) | |
tree | 97937fe23f742f6c352f39e206b7ce7d774ba358 /simon.cpp | |
parent | 6d9047b444731175e6ea9a447a3f0002685804be (diff) | |
download | cryptopp-git-b74a6f444568e59a7766d1e286f82d2ce3086dcd.tar.gz |
Add algorithm provider member function to Algorithm class
Diffstat (limited to 'simon.cpp')
-rw-r--r-- | simon.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -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 ¶ms)
{
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 ¶ms)
{
CRYPTOPP_ASSERT(keyLength == 16 || keyLength == 24 || keyLength == 32);
|