diff options
author | Jack Lloyd <[email protected]> | 2016-09-15 09:16:46 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-09-15 09:25:49 -0400 |
commit | 04bf8dc51861bab37d6260de8b318dc71ea4bba7 (patch) | |
tree | 03cf4b8d607607444049bc2b9880abc4c1fc6a8e /src/lib/block/noekeon | |
parent | a7eba3629cc0d76444f5241fb4b9e8793ddb61cd (diff) |
Add T::provider() to allow user to inquire about implementation used
For block ciphers, stream ciphers, hashes, MACs, and cipher modes.
Cipher_Mode already had it, with a slightly different usage.
Diffstat (limited to 'src/lib/block/noekeon')
-rw-r--r-- | src/lib/block/noekeon/noekeon.cpp | 12 | ||||
-rw-r--r-- | src/lib/block/noekeon/noekeon.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/block/noekeon/noekeon.cpp b/src/lib/block/noekeon/noekeon.cpp index 5e7c0229e..fbafe092e 100644 --- a/src/lib/block/noekeon/noekeon.cpp +++ b/src/lib/block/noekeon/noekeon.cpp @@ -73,6 +73,18 @@ inline void gamma(u32bit& A0, u32bit& A1, u32bit& A2, u32bit& A3) } +const char* Noekeon::provider() const + { +#if defined(BOTAN_HAS_NOEKEON_SIMD) + if(CPUID::has_simd_32()) + { + return "simd"; + } +#endif + + return "base"; + } + /* * Noekeon Round Constants */ diff --git a/src/lib/block/noekeon/noekeon.h b/src/lib/block/noekeon/noekeon.h index 30c15a001..31069eb75 100644 --- a/src/lib/block/noekeon/noekeon.h +++ b/src/lib/block/noekeon/noekeon.h @@ -21,6 +21,7 @@ class BOTAN_DLL Noekeon final : public Block_Cipher_Fixed_Params<16, 16> void encrypt_n(const byte in[], byte out[], size_t blocks) const override; void decrypt_n(const byte in[], byte out[], size_t blocks) const override; + const char* provider() const override; void clear() override; std::string name() const override { return "Noekeon"; } BlockCipher* clone() const override { return new Noekeon; } |