aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/stream/stream_cipher.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-09-17 17:08:01 -0400
committerJack Lloyd <[email protected]>2015-09-17 17:08:01 -0400
commite2e0f8f2b595122c1f8acb3b3a46501f96a2b218 (patch)
treeaf5e031cb1f83fae45d59fc05c05185de1138f9a /src/lib/stream/stream_cipher.h
parentd83ef010522373a6f8ed3876c812b18b55513103 (diff)
Handle dependencies re static linking. GH #279
Previously we were hanging on the type destructors to pull in the relevant objects. However that fails in many simple cases where the object is never deleted. For every type involved in the algo registry add static create and providers functions to access the algo registry. Modify lookup.h to be inline and call those functions, and move a few to sub-headers (eg, get_pbkdf going to pbkdf.h). So accessing the registry involves going through the same file that handles the initialization, so there is no way to end up with missing objs.
Diffstat (limited to 'src/lib/stream/stream_cipher.h')
-rw-r--r--src/lib/stream/stream_cipher.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/lib/stream/stream_cipher.h b/src/lib/stream/stream_cipher.h
index 5500bca49..68c97f1c1 100644
--- a/src/lib/stream/stream_cipher.h
+++ b/src/lib/stream/stream_cipher.h
@@ -23,6 +23,19 @@ class BOTAN_DLL StreamCipher : public SymmetricAlgorithm
typedef SCAN_Name Spec;
/**
+ * Create an instance based on a name
+ * Will return a null pointer if the algo/provider combination cannot
+ * be found. If providers is empty then best available is chosen.
+ */
+ static std::unique_ptr<StreamCipher> create(const std::string& algo_spec,
+ const std::string& provider = "");
+
+ /**
+ * Returns the list of available providers for this algorithm, empty if not available
+ */
+ static std::vector<std::string> providers(const std::string& algo_spec);
+
+ /**
* Encrypt or decrypt a message
* @param in the plaintext
* @param out the byte array to hold the output, i.e. the ciphertext
@@ -68,6 +81,7 @@ class BOTAN_DLL StreamCipher : public SymmetricAlgorithm
*/
virtual StreamCipher* clone() const = 0;
+ StreamCipher();
virtual ~StreamCipher();
};