diff options
Diffstat (limited to 'src/lib/pk_pad/emsa_pssr/pssr.cpp')
-rw-r--r-- | src/lib/pk_pad/emsa_pssr/pssr.cpp | 19 |
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 */ |