diff options
author | lloyd <[email protected]> | 2009-08-11 17:12:00 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2009-08-11 17:12:00 +0000 |
commit | 13d50de7b7675d798437c0d465acedd23e08b092 (patch) | |
tree | 7fefcd94e67475c24f58f951e117746e1984589e /src/modes/modebase.h | |
parent | f51841ba5237952dda3e76df643d3ae13bed3df5 (diff) |
Modify Keyed_Filter so it is a pure interface
Modify ECB to use parallel encryption/decryption where possible
Add toggles in build.h specifying how many blocks to process in parallel.
Defaults to 8 blocks for all modes, which is sufficient that any likely
parallelism can be extracted (via SIMD or concurrent execution) but not
so much as to seem likely to cause cache problems (8*128 bits = 128 bytes,
or two x86 cache lines)
Diffstat (limited to 'src/modes/modebase.h')
-rw-r--r-- | src/modes/modebase.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/modes/modebase.h b/src/modes/modebase.h index 173fde58c..4a15524b6 100644 --- a/src/modes/modebase.h +++ b/src/modes/modebase.h @@ -8,7 +8,7 @@ #ifndef BOTAN_MODEBASE_H__ #define BOTAN_MODEBASE_H__ -#include <botan/basefilt.h> +#include <botan/key_filt.h> #include <botan/block_cipher.h> namespace Botan { @@ -21,12 +21,17 @@ class BOTAN_DLL BlockCipherMode : public Keyed_Filter public: std::string name() const; + void set_iv(const InitializationVector&); + void set_key(const SymmetricKey& key) { cipher->set_key(key); } + + bool valid_keylength(u32bit key_len) const + { return cipher->valid_keylength(key_len); } + BlockCipherMode(BlockCipher*, const std::string&, u32bit, u32bit = 0, u32bit = 1); virtual ~BlockCipherMode() { delete cipher; } protected: - void set_iv(const InitializationVector&); const u32bit BLOCK_SIZE, BUFFER_SIZE, IV_METHOD; const std::string mode_name; BlockCipher* cipher; |