aboutsummaryrefslogtreecommitdiffstats
path: root/src/modes
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-11-08 22:02:01 +0000
committerlloyd <[email protected]>2008-11-08 22:02:01 +0000
commit6d6279835ed48e33c3cfd3174fe7c7413a0bb435 (patch)
tree595b9121d0d30b3feb3f2aa90b30e1278dd93368 /src/modes
parentda5a5cbea7f611ebf41a8d3065700106a8d89f2d (diff)
Remove use of lookup.h in CTR mode
Diffstat (limited to 'src/modes')
-rw-r--r--src/modes/ctr/ctr.cpp10
-rw-r--r--src/modes/ctr/ctr.h10
2 files changed, 9 insertions, 11 deletions
diff --git a/src/modes/ctr/ctr.cpp b/src/modes/ctr/ctr.cpp
index c537178f9..e61c8746c 100644
--- a/src/modes/ctr/ctr.cpp
+++ b/src/modes/ctr/ctr.cpp
@@ -13,19 +13,17 @@ namespace Botan {
/*************************************************
* CTR-BE Constructor *
*************************************************/
-CTR_BE::CTR_BE(const std::string& cipher_name) :
- BlockCipherMode(get_block_cipher(cipher_name),
- "CTR-BE", block_size_of(cipher_name), 1)
+CTR_BE::CTR_BE(BlockCipher* ciph) :
+ BlockCipherMode(ciph, "CTR-BE", ciph->BLOCK_SIZE, 1)
{
}
/*************************************************
* CTR-BE Constructor *
*************************************************/
-CTR_BE::CTR_BE(const std::string& cipher_name, const SymmetricKey& key,
+CTR_BE::CTR_BE(BlockCipher* ciph, const SymmetricKey& key,
const InitializationVector& iv) :
- BlockCipherMode(get_block_cipher(cipher_name),
- "CTR-BE", block_size_of(cipher_name), 1)
+ BlockCipherMode(ciph, "CTR-BE", ciph->BLOCK_SIZE, 1)
{
set_key(key);
set_iv(iv);
diff --git a/src/modes/ctr/ctr.h b/src/modes/ctr/ctr.h
index c3217a5d1..86fe3b661 100644
--- a/src/modes/ctr/ctr.h
+++ b/src/modes/ctr/ctr.h
@@ -3,10 +3,11 @@
* (C) 1999-2007 Jack Lloyd *
*************************************************/
-#ifndef BOTAN_CTR_H__
-#define BOTAN_CTR_H__
+#ifndef BOTAN_COUNTER_MODE_H_
+#define BOTAN_COUNTER_MODE_H_
#include <botan/modebase.h>
+#include <botan/modebase.h>
namespace Botan {
@@ -16,9 +17,8 @@ namespace Botan {
class BOTAN_DLL CTR_BE : public BlockCipherMode
{
public:
- CTR_BE(const std::string&);
- CTR_BE(const std::string&,
- const SymmetricKey&, const InitializationVector&);
+ CTR_BE(BlockCipher*);
+ CTR_BE(BlockCipher*, const SymmetricKey&, const InitializationVector&);
private:
void write(const byte[], u32bit);
void increment_counter();