aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorlloyd <[email protected]>2008-09-28 23:42:02 +0000
committerlloyd <[email protected]>2008-09-28 23:42:02 +0000
commitd4647b485a4123f0163ae541439af3f21e26b101 (patch)
tree88a4a07a0f10f33b8064cbf6e5a99184a747eb4f /src
parent45e73451bcc20838b723f1871290a9badb906dac (diff)
Add modebase module (and add dep in cipher mode impls). Move data_snk.cpp to filters
Diffstat (limited to 'src')
-rw-r--r--src/filters/data_snk.cpp (renamed from src/data_snk.cpp)0
-rw-r--r--src/filters/modinfo.txt2
-rw-r--r--src/modes/cbc/modinfo.txt5
-rw-r--r--src/modes/cfb/modinfo.txt5
-rw-r--r--src/modes/ctr/modinfo.txt5
-rw-r--r--src/modes/cts/modinfo.txt5
-rw-r--r--src/modes/eax/modinfo.txt5
-rw-r--r--src/modes/ecb/modinfo.txt5
-rw-r--r--src/modes/modebase/modebase.cpp (renamed from src/modebase.cpp)0
-rw-r--r--src/modes/modebase/modebase.h35
-rw-r--r--src/modes/ofb/modinfo.txt5
11 files changed, 72 insertions, 0 deletions
diff --git a/src/data_snk.cpp b/src/filters/data_snk.cpp
index bb5226f0c..bb5226f0c 100644
--- a/src/data_snk.cpp
+++ b/src/filters/data_snk.cpp
diff --git a/src/filters/modinfo.txt b/src/filters/modinfo.txt
index 62e2d9807..d21c864b5 100644
--- a/src/filters/modinfo.txt
+++ b/src/filters/modinfo.txt
@@ -8,12 +8,14 @@ define FILTERS
algo_filt.cpp
basefilt.cpp
buf_filt.cpp
+data_snk.cpp
filter.cpp
out_buf.cpp
pipe.cpp
pipe_io.cpp
pipe_rw.cpp
secqueue.cpp
+
basefilt.h
buf_filt.h
data_snk.h
diff --git a/src/modes/cbc/modinfo.txt b/src/modes/cbc/modinfo.txt
index 4ebc7730a..4c975eb9f 100644
--- a/src/modes/cbc/modinfo.txt
+++ b/src/modes/cbc/modinfo.txt
@@ -8,3 +8,8 @@ load_on auto
cbc.cpp
cbc.h
</add>
+
+<requires>
+modebase
+</requires>
+
diff --git a/src/modes/cfb/modinfo.txt b/src/modes/cfb/modinfo.txt
index edce3a7e3..0a1af3d15 100644
--- a/src/modes/cfb/modinfo.txt
+++ b/src/modes/cfb/modinfo.txt
@@ -8,3 +8,8 @@ load_on auto
cfb.cpp
cfb.h
</add>
+
+<requires>
+modebase
+</requires>
+
diff --git a/src/modes/ctr/modinfo.txt b/src/modes/ctr/modinfo.txt
index 912b80f51..8772f178f 100644
--- a/src/modes/ctr/modinfo.txt
+++ b/src/modes/ctr/modinfo.txt
@@ -8,3 +8,8 @@ load_on auto
ctr.cpp
ctr.h
</add>
+
+<requires>
+modebase
+</requires>
+
diff --git a/src/modes/cts/modinfo.txt b/src/modes/cts/modinfo.txt
index 9f36221b4..83bbd8302 100644
--- a/src/modes/cts/modinfo.txt
+++ b/src/modes/cts/modinfo.txt
@@ -8,3 +8,8 @@ load_on auto
cts.cpp
cts.h
</add>
+
+<requires>
+modebase
+</requires>
+
diff --git a/src/modes/eax/modinfo.txt b/src/modes/eax/modinfo.txt
index 7d5f7e98c..f31dd378e 100644
--- a/src/modes/eax/modinfo.txt
+++ b/src/modes/eax/modinfo.txt
@@ -9,3 +9,8 @@ eax.cpp
eax.h
eax_dec.cpp
</add>
+
+<requires>
+modebase
+</requires>
+
diff --git a/src/modes/ecb/modinfo.txt b/src/modes/ecb/modinfo.txt
index fb0c8b7c6..039a83739 100644
--- a/src/modes/ecb/modinfo.txt
+++ b/src/modes/ecb/modinfo.txt
@@ -8,3 +8,8 @@ load_on auto
ecb.cpp
ecb.h
</add>
+
+<requires>
+modebase
+</requires>
+
diff --git a/src/modebase.cpp b/src/modes/modebase/modebase.cpp
index 6661d9f33..6661d9f33 100644
--- a/src/modebase.cpp
+++ b/src/modes/modebase/modebase.cpp
diff --git a/src/modes/modebase/modebase.h b/src/modes/modebase/modebase.h
new file mode 100644
index 000000000..90ab277b2
--- /dev/null
+++ b/src/modes/modebase/modebase.h
@@ -0,0 +1,35 @@
+/*************************************************
+* Block Cipher Mode Header File *
+* (C) 1999-2007 Jack Lloyd *
+*************************************************/
+
+#ifndef BOTAN_MODEBASE_H__
+#define BOTAN_MODEBASE_H__
+
+#include <botan/basefilt.h>
+
+namespace Botan {
+
+/*************************************************
+* Block Cipher Mode *
+*************************************************/
+class BOTAN_DLL BlockCipherMode : public Keyed_Filter
+ {
+ public:
+ std::string name() const;
+
+ BlockCipherMode(const std::string&, 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
diff --git a/src/modes/ofb/modinfo.txt b/src/modes/ofb/modinfo.txt
index 38a15d0b6..ab4aa823a 100644
--- a/src/modes/ofb/modinfo.txt
+++ b/src/modes/ofb/modinfo.txt
@@ -8,3 +8,8 @@ load_on auto
ofb.cpp
ofb.h
</add>
+
+<requires>
+modebase
+</requires>
+