aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/pk_pad/emsa_pssr/pssr.cpp
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-01-31 16:18:09 +0000
committerlloyd <[email protected]>2015-01-31 16:18:09 +0000
commitfd3016d10124d2b7ccd7bc885235f2e407d73800 (patch)
treee237b54c3a8d465c893a012157d9d52014eaccc9 /src/lib/pk_pad/emsa_pssr/pssr.cpp
parent00c9b3f4834603946065c15b9b2e9fa5e973b979 (diff)
Use registry also for KDF, EMSA, and EME
Diffstat (limited to 'src/lib/pk_pad/emsa_pssr/pssr.cpp')
-rw-r--r--src/lib/pk_pad/emsa_pssr/pssr.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/lib/pk_pad/emsa_pssr/pssr.cpp b/src/lib/pk_pad/emsa_pssr/pssr.cpp
index a7e5de6f1..3f93ca79d 100644
--- a/src/lib/pk_pad/emsa_pssr/pssr.cpp
+++ b/src/lib/pk_pad/emsa_pssr/pssr.cpp
@@ -5,13 +5,30 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
+#include <botan/internal/pad_utils.h>
#include <botan/pssr.h>
#include <botan/mgf1.h>
#include <botan/internal/bit_ops.h>
-#include <botan/internal/xor_buf.h>
namespace Botan {
+PSSR* PSSR::make(const Spec& request)
+ {
+ if(request.arg(1, "MGF1") != "MGF1")
+ return nullptr;
+
+ auto hash = make_a<HashFunction>(request.arg(0));
+
+ if(!hash)
+ return nullptr;
+
+ const size_t salt_size = request.arg_as_integer(2, hash->output_length());
+
+ return new PSSR(hash, salt_size);
+ }
+
+BOTAN_REGISTER_NAMED_T(EMSA, "PSSR", PSSR, PSSR::make);
+
/*
* PSSR Update Operation
*/