Botan 1.10.17

prov_weight.cpp
Go to the documentation of this file.
1 /*
2 * Default provider weights for Algorithm_Cache
3 * (C) 2008 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7
8 #include <botan/internal/algo_cache.h>
9
10 namespace Botan {
11
12 /**
13 * Return a static provider weighing
14 */
15 size_t static_provider_weight(const std::string& prov_name)
16 {
17 /*
18 * Prefer asm over C++, but prefer anything over OpenSSL or GNU MP; to use
19 * them, set the provider explicitly for the algorithms you want
20 */
21
22 if(prov_name == "aes_isa") return 9;
23 if(prov_name == "simd") return 8;
24 if(prov_name == "asm") return 7;
25
26 if(prov_name == "core") return 5;
27
28 if(prov_name == "openssl") return 2;
29 if(prov_name == "gmp") return 1;
30
31 return 0; // other/unknown
32 }
33
34 }
Botan::static_provider_weight
size_t static_provider_weight(const std::string &prov_name)
Definition: prov_weight.cpp:15
Botan
Definition: algo_base.h:14