aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pk_pad/eme.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-09-11 22:44:45 -0400
committerJack Lloyd <[email protected]>2015-09-11 22:44:45 -0400
commit72719f52640d2ac3ff00fce46a72082e5938d212 (patch)
tree51018f639724326c0e967eb7372a762ce0b89e53 /src/lib/pk_pad/eme.cpp
parent8211fdc11fa3bbe692b50d42126f74d259a4a96a (diff)
Fix pbkdf, pk padding and ECDH registration for static linking.
With this change the tests pass when linked against a static library built in the normal (non-amalgamation) fashion. Remove the restriction in configure.py, and have circleci build the clang static build as a non-amalg.
Diffstat (limited to 'src/lib/pk_pad/eme.cpp')
-rw-r--r--src/lib/pk_pad/eme.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/lib/pk_pad/eme.cpp b/src/lib/pk_pad/eme.cpp
index 9398b4c83..153ef8922 100644
--- a/src/lib/pk_pad/eme.cpp
+++ b/src/lib/pk_pad/eme.cpp
@@ -6,9 +6,47 @@
*/
#include <botan/eme.h>
+#include <botan/internal/pad_utils.h>
+
+#if defined(BOTAN_HAS_EME_OAEP)
+#include <botan/oaep.h>
+#endif
+
+#if defined(BOTAN_HAS_EME_PKCS1v15)
+#include <botan/eme_pkcs.h>
+#endif
+
+#if defined(BOTAN_HAS_EME_RAW)
+#include <botan/eme_raw.h>
+#endif
namespace Botan {
+#if defined(BOTAN_HAS_EME_OAEP)
+BOTAN_REGISTER_NAMED_T(EME, "OAEP", OAEP, OAEP::make);
+#endif
+
+#if defined(BOTAN_HAS_EME_PKCS1v15)
+BOTAN_REGISTER_EME_NAMED_NOARGS(EME_PKCS1v15, "PKCS1v15");
+#endif
+
+#if defined(BOTAN_HAS_EME_RAW)
+BOTAN_REGISTER_EME_NAMED_NOARGS(EME_Raw, "Raw");
+#endif
+
+EME* get_eme(const std::string& algo_spec)
+ {
+ SCAN_Name request(algo_spec);
+
+ if(EME* eme = make_a<EME>(algo_spec))
+ return eme;
+
+ if(request.algo_name() == "Raw")
+ return nullptr; // No padding
+
+ throw Algorithm_Not_Found(algo_spec);
+ }
+
/*
* Encode a message
*/