From e14d6a0489ee290d289cf276fa3ff94044191af7 Mon Sep 17 00:00:00 2001 From: René Korthaus Date: Wed, 13 Apr 2016 19:07:33 +0200 Subject: Add ECKCDSA signature algorithm --- src/lib/pk_pad/emsa.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/lib/pk_pad/emsa.cpp') diff --git a/src/lib/pk_pad/emsa.cpp b/src/lib/pk_pad/emsa.cpp index 3b8641357..91bf44cf8 100644 --- a/src/lib/pk_pad/emsa.cpp +++ b/src/lib/pk_pad/emsa.cpp @@ -45,6 +45,19 @@ EMSA* get_emsa(const std::string& algo_spec) throw Algorithm_Not_Found(algo_spec); } +std::string hash_for_emsa(const std::string& algo_spec) + { + SCAN_Name emsa_name(algo_spec); + + if(emsa_name.arg_count() > 0) + { + const std::string pos_hash = emsa_name.arg(0); + return pos_hash; + } + + return "SHA-512"; // safe default if nothing we understand + } + #define BOTAN_REGISTER_EMSA_NAMED_NOARGS(type, name) \ BOTAN_REGISTER_NAMED_T(EMSA, name, type, make_new_T) -- cgit v1.2.3