27 {
28#if defined(BOTAN_HAS_EME_RAW)
29 if(algo_spec == "Raw") {
30 return std::make_unique<EME_Raw>();
31 }
32#endif
33
34#if defined(BOTAN_HAS_EME_PKCS1)
35
36 if(algo_spec == "PKCS1v15" || algo_spec == "EME-PKCS1-v1_5") {
37 return std::make_unique<EME_PKCS1v15>();
38 }
39#endif
40
41#if defined(BOTAN_HAS_EME_OAEP)
42 SCAN_Name req(algo_spec);
43
44
45 if(req.algo_name() == "OAEP" || req.algo_name() == "EME-OAEP" || req.algo_name() == "EME1") {
46 if(req.arg_count() == 1 || ((req.arg_count() == 2 || req.arg_count() == 3) && req.arg(1) == "MGF1")) {
48 return std::make_unique<OAEP>(std::move(hash), req.arg(2, ""));
49 }
50 } else if(req.arg_count() == 2 || req.arg_count() == 3) {
52
53 if(mgf_params.size() == 2 && mgf_params[0] == "MGF1") {
56
57 if(hash && mgf1_hash) {
58 return std::make_unique<OAEP>(std::move(hash), std::move(mgf1_hash), req.arg(2, ""));
59 }
60 }
61 }
62 }
63#endif
64
65 throw Algorithm_Not_Found(algo_spec);
66}
static std::unique_ptr< HashFunction > create(std::string_view algo_spec, std::string_view provider="")
std::vector< std::string > parse_algorithm_name(std::string_view namex)