aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/filters.h1
-rw-r--r--src/filters.cpp11
2 files changed, 12 insertions, 0 deletions
diff --git a/include/filters.h b/include/filters.h
index 377181d63..c088e36a4 100644
--- a/include/filters.h
+++ b/include/filters.h
@@ -28,6 +28,7 @@ class StreamCipher_Filter : public Keyed_Filter
void write(const byte[], u32bit);
StreamCipher_Filter(const std::string&);
+ StreamCipher_Filter(const std::string&, const SymmetricKey&);
~StreamCipher_Filter() { delete cipher; }
private:
SecureVector<byte> buffer;
diff --git a/src/filters.cpp b/src/filters.cpp
index aadc32c4e..9ea082980 100644
--- a/src/filters.cpp
+++ b/src/filters.cpp
@@ -19,6 +19,17 @@ StreamCipher_Filter::StreamCipher_Filter(const std::string& sc_name) :
}
/*************************************************
+* StreamCipher_Filter Constructor *
+*************************************************/
+StreamCipher_Filter::StreamCipher_Filter(const std::string& sc_name,
+ const SymmetricKey& key) :
+ buffer(DEFAULT_BUFFERSIZE)
+ {
+ base_ptr = cipher = get_stream_cipher(sc_name);
+ cipher->set_key(key);
+ }
+
+/*************************************************
* Set the IV of a stream cipher *
*************************************************/
void StreamCipher_Filter::set_iv(const InitializationVector& iv)