aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/filters
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-02-04 04:03:38 +0000
committerlloyd <[email protected]>2015-02-04 04:03:38 +0000
commit0dd060fed07b0060f94e3bae62e125a85c1bb877 (patch)
treeed4bc7a961e2b30f17ed5e80769c84b0c313c8b7 /src/lib/filters
parentf9a7c85b74be0f4a7273e8e0591703af83036e81 (diff)
Remove algo factory, engines, global RNG, global state, etc.
Convert all uses of Algorithm_Factory and the engines to using Algo_Registry The shared pool of entropy sources remains but is moved to EntropySource. With that and few remaining initializations (default OIDs and aliases) moved elsewhere, the global state is empty and init and shutdown are no-ops. Remove almost all of the headers and code for handling the global state, except LibraryInitializer which remains as a compatability stub. Update seeding for blinding so only one hacky almost-global RNG instance needs to be setup instead of across all pubkey uses (it uses either the system RNG or an AutoSeeded_RNG if the system RNG is not available).
Diffstat (limited to 'src/lib/filters')
-rw-r--r--src/lib/filters/aead_filt.h (renamed from src/lib/filters/aead_filt/aead_filt.h)0
-rw-r--r--src/lib/filters/aead_filt/info.txt5
-rw-r--r--src/lib/filters/algo_filt.cpp2
-rw-r--r--src/lib/filters/info.txt11
-rw-r--r--src/lib/filters/key_filt.h46
5 files changed, 49 insertions, 15 deletions
diff --git a/src/lib/filters/aead_filt/aead_filt.h b/src/lib/filters/aead_filt.h
index a97b580bd..a97b580bd 100644
--- a/src/lib/filters/aead_filt/aead_filt.h
+++ b/src/lib/filters/aead_filt.h
diff --git a/src/lib/filters/aead_filt/info.txt b/src/lib/filters/aead_filt/info.txt
deleted file mode 100644
index 891f2c167..000000000
--- a/src/lib/filters/aead_filt/info.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-define AEAD_FILTER 20131128
-
-<requires>
-aead
-</requires>
diff --git a/src/lib/filters/algo_filt.cpp b/src/lib/filters/algo_filt.cpp
index 828f15155..c1f7b00e2 100644
--- a/src/lib/filters/algo_filt.cpp
+++ b/src/lib/filters/algo_filt.cpp
@@ -6,7 +6,7 @@
*/
#include <botan/filters.h>
-#include <botan/algo_registry.h>
+#include <botan/internal/algo_registry.h>
#include <algorithm>
namespace Botan {
diff --git a/src/lib/filters/info.txt b/src/lib/filters/info.txt
index 7bb98a516..da6827833 100644
--- a/src/lib/filters/info.txt
+++ b/src/lib/filters/info.txt
@@ -8,6 +8,7 @@ comp_filter.cpp
data_snk.cpp
data_src.cpp
filter.cpp
+key_filt.cpp
out_buf.cpp
pipe.cpp
pipe_io.cpp
@@ -36,14 +37,6 @@ out_buf.h
</header:internal>
<requires>
-alloc
-asn1
-block
compression
-hash
-libstate
-mac
-rng
-stream
-algo_base
+modes
</requires>
diff --git a/src/lib/filters/key_filt.h b/src/lib/filters/key_filt.h
index c2a1fd92b..96b472b7e 100644
--- a/src/lib/filters/key_filt.h
+++ b/src/lib/filters/key_filt.h
@@ -57,6 +57,52 @@ class BOTAN_DLL Keyed_Filter : public Filter
{ return (length == 0); }
};
+
+
+/*
+* Get a cipher object
+*/
+
+/**
+* Factory method for general symmetric cipher filters.
+* @param algo_spec the name of the desired cipher
+* @param key the key to be used for encryption/decryption performed by
+* the filter
+* @param iv the initialization vector to be used
+* @param direction determines whether the filter will be an encrypting
+* or decrypting filter
+* @return pointer to newly allocated encryption or decryption filter
+*/
+BOTAN_DLL Keyed_Filter* get_cipher(const std::string& algo_spec,
+ const SymmetricKey& key,
+ const InitializationVector& iv,
+ Cipher_Dir direction);
+
+/**
+* Factory method for general symmetric cipher filters.
+* @param algo_spec the name of the desired cipher
+* @param key the key to be used for encryption/decryption performed by
+* the filter
+* @param direction determines whether the filter will be an encrypting
+* or decrypting filter
+* @return pointer to the encryption or decryption filter
+*/
+BOTAN_DLL Keyed_Filter* get_cipher(const std::string& algo_spec,
+ const SymmetricKey& key,
+ Cipher_Dir direction);
+
+/**
+* Factory method for general symmetric cipher filters. No key will be
+* set in the filter.
+*
+* @param algo_spec the name of the desired cipher
+* @param direction determines whether the filter will be an encrypting or
+* decrypting filter
+* @return pointer to the encryption or decryption filter
+*/
+BOTAN_DLL Keyed_Filter* get_cipher(const std::string& algo_spec,
+ Cipher_Dir direction);
+
}
#endif