aboutsummaryrefslogtreecommitdiffstats
path: root/modules/modes/cbc/cbc.h
diff options
context:
space:
mode:
Diffstat (limited to 'modules/modes/cbc/cbc.h')
-rw-r--r--modules/modes/cbc/cbc.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/modules/modes/cbc/cbc.h b/modules/modes/cbc/cbc.h
new file mode 100644
index 000000000..a0a30f90f
--- /dev/null
+++ b/modules/modes/cbc/cbc.h
@@ -0,0 +1,49 @@
+/*************************************************
+* CBC Mode Header File *
+* (C) 1999-2007 Jack Lloyd *
+*************************************************/
+
+#ifndef BOTAN_CBC_H__
+#define BOTAN_CBC_H__
+
+#include <botan/modebase.h>
+#include <botan/mode_pad.h>
+
+namespace Botan {
+
+/*************************************************
+* CBC Encryption *
+*************************************************/
+class BOTAN_DLL CBC_Encryption : public BlockCipherMode
+ {
+ public:
+ CBC_Encryption(const std::string&, const std::string&);
+ CBC_Encryption(const std::string&, const std::string&,
+ const SymmetricKey&, const InitializationVector&);
+ private:
+ std::string name() const;
+ void write(const byte[], u32bit);
+ void end_msg();
+ const BlockCipherModePaddingMethod* padder;
+ };
+
+/*************************************************
+* CBC Decryption *
+*************************************************/
+class BOTAN_DLL CBC_Decryption : public BlockCipherMode
+ {
+ public:
+ CBC_Decryption(const std::string&, const std::string&);
+ CBC_Decryption(const std::string&, const std::string&,
+ const SymmetricKey&, const InitializationVector&);
+ private:
+ std::string name() const;
+ void write(const byte[], u32bit);
+ void end_msg();
+ const BlockCipherModePaddingMethod* padder;
+ SecureVector<byte> temp;
+ };
+
+}
+
+#endif