aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/mac/mac.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-09-21 16:09:36 -0400
committerJack Lloyd <[email protected]>2015-09-21 16:09:36 -0400
commit7ebe7511496b8a6950acced513a81516565354ed (patch)
treeadd1163c2afbd1ae3d163aaac8375a3b56bd6c9c /src/lib/mac/mac.h
parent8f732dccce692eaca509fc9732702df62cfa5c87 (diff)
parent04319af23bf8ed467b17f9b74c814343e051ab6b (diff)
Merge pull request #279 from randombit/fix-static-lib-registration
Move the algorithm factory functions to T::create and move object registration to the source file for its base class. These resolve the issues which prevented successful use of a static library that was built with individual object files. Removes the restriction in configure.py which prevented building non-amalgamation static libs.
Diffstat (limited to 'src/lib/mac/mac.h')
-rw-r--r--src/lib/mac/mac.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/lib/mac/mac.h b/src/lib/mac/mac.h
index 8ad2d1e99..90ef4db15 100644
--- a/src/lib/mac/mac.h
+++ b/src/lib/mac/mac.h
@@ -22,6 +22,23 @@ class BOTAN_DLL MessageAuthenticationCode : public Buffered_Computation,
public SymmetricAlgorithm
{
public:
+ 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 provider is empty then best available is chosen.
+ */
+ static std::unique_ptr<MessageAuthenticationCode> 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);
+
+ virtual ~MessageAuthenticationCode();
+
/**
* Verify a MAC.
* @param in the MAC to verify as a byte array
@@ -34,8 +51,6 @@ class BOTAN_DLL MessageAuthenticationCode : public Buffered_Computation,
* Get a new object representing the same algorithm as *this
*/
virtual MessageAuthenticationCode* clone() const = 0;
-
- typedef SCAN_Name Spec;
};
}