aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/cascade
diff options
context:
space:
mode:
Diffstat (limited to 'src/block/cascade')
-rw-r--r--src/block/cascade/cascade.cpp7
-rw-r--r--src/block/cascade/cascade.h6
2 files changed, 9 insertions, 4 deletions
diff --git a/src/block/cascade/cascade.cpp b/src/block/cascade/cascade.cpp
index 2701c20e7..f1b1a8f2c 100644
--- a/src/block/cascade/cascade.cpp
+++ b/src/block/cascade/cascade.cpp
@@ -31,10 +31,10 @@ void Cascade_Cipher::decrypt_n(const byte in[], byte out[],
void Cascade_Cipher::key_schedule(const byte key[], size_t)
{
- const byte* key2 = key + cipher1->MAXIMUM_KEYLENGTH;
+ const byte* key2 = key + cipher1->maximum_keylength();
- cipher1->set_key(key , cipher1->MAXIMUM_KEYLENGTH);
- cipher2->set_key(key2, cipher2->MAXIMUM_KEYLENGTH);
+ cipher1->set_key(key , cipher1->maximum_keylength());
+ cipher2->set_key(key2, cipher2->maximum_keylength());
}
void Cascade_Cipher::clear()
@@ -81,7 +81,6 @@ size_t block_size_for_cascade(size_t bs, size_t bs2)
}
Cascade_Cipher::Cascade_Cipher(BlockCipher* c1, BlockCipher* c2) :
- BlockCipher(c1->MAXIMUM_KEYLENGTH + c2->MAXIMUM_KEYLENGTH),
cipher1(c1), cipher2(c2)
{
block = block_size_for_cascade(c1->block_size(), c2->block_size());
diff --git a/src/block/cascade/cascade.h b/src/block/cascade/cascade.h
index 31ee3b336..b1376e2e0 100644
--- a/src/block/cascade/cascade.h
+++ b/src/block/cascade/cascade.h
@@ -23,6 +23,12 @@ class BOTAN_DLL Cascade_Cipher : public BlockCipher
size_t block_size() const { return block; }
+ Key_Length_Specification key_spec() const
+ {
+ return Key_Length_Specification(cipher1->maximum_keylength() +
+ cipher2->maximum_keylength());
+ }
+
void clear();
std::string name() const;
BlockCipher* clone() const;