aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/block/xtea_simd/xtea_simd.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-01-28 04:32:10 +0000
committerlloyd <[email protected]>2015-01-28 04:32:10 +0000
commit7b56f1bd570dc684ffd7c945dee0d9b5480354ff (patch)
tree0c50ad534280a292a1b76daee9a19b34cfd96367 /src/lib/block/xtea_simd/xtea_simd.cpp
parentb8fa304ec981d273c45d7ef31705d65ccfb00cc1 (diff)
Add a runtime map of string->func() which when called return
Transforms and BlockCiphers. Registration for all types is done at startup but is very cheap as just a std::function and a std::map entry are created, no actual objects are created until needed. This is a huge improvement over Algorithm_Factory which used T::clone() as the function and thus kept a prototype object of each type in memory. Replace existing lookup mechanisms for ciphers, AEADs, and compression to use the transform lookup. The existing Engine framework remains in place for BlockCipher, but the engines now just call to the registry instead of having hardcoded lookups. s/Transformation/Transform/ with typedefs for compatability. Remove lib/selftest code (for runtime selftesting): not the right approach.
Diffstat (limited to 'src/lib/block/xtea_simd/xtea_simd.cpp')
-rw-r--r--src/lib/block/xtea_simd/xtea_simd.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/block/xtea_simd/xtea_simd.cpp b/src/lib/block/xtea_simd/xtea_simd.cpp
index 87c7a20bf..6fd2f94c7 100644
--- a/src/lib/block/xtea_simd/xtea_simd.cpp
+++ b/src/lib/block/xtea_simd/xtea_simd.cpp
@@ -5,12 +5,14 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
+#include <botan/internal/block_utils.h>
#include <botan/xtea_simd.h>
-#include <botan/loadstor.h>
#include <botan/internal/simd_32.h>
namespace Botan {
+BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(SIMD_32::enabled(), XTEA_SIMD, "XTEA", "simd32");
+
namespace {
void xtea_encrypt_8(const byte in[64], byte out[64], const u32bit EK[64])