diff options
author | lloyd <[email protected]> | 2015-01-28 04:32:10 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2015-01-28 04:32:10 +0000 |
commit | 7b56f1bd570dc684ffd7c945dee0d9b5480354ff (patch) | |
tree | 0c50ad534280a292a1b76daee9a19b34cfd96367 /src/lib/block/safer/safer_sk.cpp | |
parent | b8fa304ec981d273c45d7ef31705d65ccfb00cc1 (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/safer/safer_sk.cpp')
-rw-r--r-- | src/lib/block/safer/safer_sk.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/lib/block/safer/safer_sk.cpp b/src/lib/block/safer/safer_sk.cpp index 390e5d9bb..f5996a986 100644 --- a/src/lib/block/safer/safer_sk.cpp +++ b/src/lib/block/safer/safer_sk.cpp @@ -5,15 +5,16 @@ * Botan is released under the Simplified BSD License (see license.txt) */ +#include <botan/internal/block_utils.h> #include <botan/safer_sk.h> -#include <botan/rotate.h> #include <botan/parsing.h> -#include <botan/rotate.h> namespace Botan { namespace { +BOTAN_REGISTER_BLOCK_CIPHER_NAMED_1LEN(SAFER_SK, "SAFER-SK", 10); + const byte EXP[256] = { 0x01, 0x2D, 0xE2, 0x93, 0xBE, 0x45, 0x15, 0xAE, 0x78, 0x03, 0x87, 0xA4, 0xB8, 0x38, 0xCF, 0x3F, 0x08, 0x67, 0x09, 0x94, 0xEB, 0x26, 0xA8, 0x6B, |