aboutsummaryrefslogtreecommitdiffstats
path: root/src/block/cascade/cascade.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2010-01-11 22:07:34 +0000
committerlloyd <[email protected]>2010-01-11 22:07:34 +0000
commitf5fd85b0ea6a5a6975d595130e029f94fddae9a4 (patch)
tree3e1de8daf0e513096a8a98f6a087015e85081340 /src/block/cascade/cascade.h
parent3c3ca9050f2ffbb9bb3417e2d71142e9550936df (diff)
Add block cipher cascade
Diffstat (limited to 'src/block/cascade/cascade.h')
-rw-r--r--src/block/cascade/cascade.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/block/cascade/cascade.h b/src/block/cascade/cascade.h
new file mode 100644
index 000000000..98c64fb3e
--- /dev/null
+++ b/src/block/cascade/cascade.h
@@ -0,0 +1,41 @@
+/*
+* Block Cipher Cascade
+* (C) 2010 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
+
+#ifndef BOTAN_CASCADE_H__
+#define BOTAN_CASCADE_H__
+
+#include <botan/block_cipher.h>
+
+namespace Botan {
+
+/*
+* Block Cipher Cascade
+*/
+class BOTAN_DLL Cascade_Cipher : public BlockCipher
+ {
+ public:
+ void encrypt_n(const byte in[], byte out[], u32bit blocks) const;
+ void decrypt_n(const byte in[], byte out[], u32bit blocks) const;
+
+ void clear();
+ std::string name() const;
+ BlockCipher* clone() const;
+
+ Cascade_Cipher(BlockCipher* cipher1, BlockCipher* cipher2);
+
+ ~Cascade_Cipher();
+ private:
+ void key_schedule(const byte[], u32bit);
+
+ BlockCipher* cipher1;
+ BlockCipher* cipher2;
+ };
+
+
+}
+
+#endif