From 7b56f1bd570dc684ffd7c945dee0d9b5480354ff Mon Sep 17 00:00:00 2001 From: lloyd Date: Wed, 28 Jan 2015 04:32:10 +0000 Subject: 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. --- src/lib/block/block_cipher.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/lib/block/block_cipher.h') diff --git a/src/lib/block/block_cipher.h b/src/lib/block/block_cipher.h index 19dbc8e57..73e67b790 100644 --- a/src/lib/block/block_cipher.h +++ b/src/lib/block/block_cipher.h @@ -8,6 +8,7 @@ #ifndef BOTAN_BLOCK_CIPHER_H__ #define BOTAN_BLOCK_CIPHER_H__ +#include #include namespace Botan { @@ -18,6 +19,7 @@ namespace Botan { class BOTAN_DLL BlockCipher : public SymmetricAlgorithm { public: + typedef SCAN_Name Spec; /** * @return block size of this algorithm -- cgit v1.2.3