diff options
author | Jack Lloyd <[email protected]> | 2016-06-20 01:23:34 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2016-06-20 01:37:01 -0400 |
commit | 9a6621f473de4d2a49ed47e9a3db7cbf574b9236 (patch) | |
tree | c2f025bd0179d6568a3e46b1713c2dbf69629067 /src/lib/pk_pad/emsa.cpp | |
parent | 17741e56503bf538b5cceb29269c1f4981f649fb (diff) | |
parent | 70a61c082408a22b516fbe0f3a81441c6c5f165e (diff) |
Merge GH #504 Add ECKCDSA
Diffstat (limited to 'src/lib/pk_pad/emsa.cpp')
-rw-r--r-- | src/lib/pk_pad/emsa.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/lib/pk_pad/emsa.cpp b/src/lib/pk_pad/emsa.cpp index 0501bc5f4..4d4b96ad1 100644 --- a/src/lib/pk_pad/emsa.cpp +++ b/src/lib/pk_pad/emsa.cpp @@ -41,6 +41,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<type>) |