blob: e64c4e9d89863a939a08485810c57007fa345128 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
/*
* EMSA/EME Retrieval
* (C) 1999-2007 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
#include <botan/emsa.h>
#include <botan/eme.h>
#include <botan/scan_name.h>
#include <botan/algo_registry.h>
namespace Botan {
EMSA* get_emsa(const std::string& algo_spec)
{
SCAN_Name request(algo_spec);
if(EMSA* emsa = make_a<EMSA>(algo_spec))
return emsa;
printf("EMSA missing? %s\n", algo_spec.c_str());
throw Algorithm_Not_Found(algo_spec);
}
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);
}
}
|