summaryrefslogtreecommitdiffstats
path: root/botan/build/botan/modebase.h
diff options
context:
space:
mode:
Diffstat (limited to 'botan/build/botan/modebase.h')
-rw-r--r--botan/build/botan/modebase.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/botan/build/botan/modebase.h b/botan/build/botan/modebase.h
new file mode 100644
index 0000000..173fde5
--- /dev/null
+++ b/botan/build/botan/modebase.h
@@ -0,0 +1,39 @@
+/*
+* Block Cipher Mode
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
+
+#ifndef BOTAN_MODEBASE_H__
+#define BOTAN_MODEBASE_H__
+
+#include <botan/basefilt.h>
+#include <botan/block_cipher.h>
+
+namespace Botan {
+
+/**
+* This class represents an abstract block cipher mode
+*/
+class BOTAN_DLL BlockCipherMode : public Keyed_Filter
+ {
+ public:
+ std::string name() const;
+
+ 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;
+ SecureVector<byte> buffer, state;
+ u32bit position;
+ };
+
+}
+
+#endif