Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

lookup.h
Go to the documentation of this file.
1 /*
2 * Algorithm Lookup
3 * (C) 1999-2007,2015 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7
8 #ifndef BOTAN_LOOKUP_H__
9 #define BOTAN_LOOKUP_H__
10
11 #include <botan/block_cipher.h>
12 #include <botan/stream_cipher.h>
13 #include <botan/hash.h>
14 #include <botan/mac.h>
15 #include <botan/exceptn.h>
16 #include <string>
17 #include <vector>
18 #include <memory>
19
20 namespace Botan {
21
22 /*
23 * As of 1.11.26 this header is deprecated. Instead use the calls T::create and
24 * T::providers (as demonstrated in the implementation below).
25 */
26
27 /*
28 * Get an algorithm object
29 * NOTE: these functions create and return new objects, letting the
30 * caller assume ownership of them
31 */
32
33 /**
34 * Block cipher factory method.
35 *
36 * @param algo_spec the name of the desired block cipher
37 * @param provider the provider to use
38 * @return pointer to the block cipher object
39 */
40 BOTAN_DEPRECATED("Use BlockCipher::create")
41 inline BlockCipher* get_block_cipher(const std::string& algo_spec,
42 const std::string& provider = "")
43 {
44 return BlockCipher::create(algo_spec, provider).release();
45 }
46
47 BOTAN_DEPRECATED("Use BlockCipher::create_or_throw")
48 inline std::unique_ptr<BlockCipher> make_block_cipher(const std::string& algo_spec,
49 const std::string& provider = "")
50 {
51 return BlockCipher::create_or_throw(algo_spec, provider);
52 }
53
54 BOTAN_DEPRECATED("Use BlockCipher::providers")
55 inline std::vector<std::string> get_block_cipher_providers(const std::string& algo_spec)
56 {
57 return BlockCipher::providers(algo_spec);
58 }
59
60 /**
61 * Stream cipher factory method.
62 *
63 * @param algo_spec the name of the desired stream cipher
64 * @param provider the provider to use
65 * @return pointer to the stream cipher object
66 */
67 BOTAN_DEPRECATED("Use StreamCipher::create")
68 inline StreamCipher* get_stream_cipher(const std::string& algo_spec,
69 const std::string& provider = "")
70 {
71 return StreamCipher::create(algo_spec, provider).release();
72 }
73
74 BOTAN_DEPRECATED("Use StreamCipher::create_or_throw")
75 inline std::unique_ptr<StreamCipher> make_stream_cipher(const std::string& algo_spec,
76 const std::string& provider = "")
77 {
78 return StreamCipher::create_or_throw(algo_spec, provider);
79 }
80
81 BOTAN_DEPRECATED("Use StreamCipher::providers")
82 inline std::vector<std::string> get_stream_cipher_providers(const std::string& algo_spec)
83 {
84 return StreamCipher::providers(algo_spec);
85 }
86
87 /**
88 * Hash function factory method.
89 *
90 * @param algo_spec the name of the desired hash function
91 * @param provider the provider to use
92 * @return pointer to the hash function object
93 */
94 BOTAN_DEPRECATED("Use HashFunction::create")
95 inline HashFunction* get_hash_function(const std::string& algo_spec,
96 const std::string& provider = "")
97 {
98 return HashFunction::create(algo_spec, provider).release();
99 }
100
101 BOTAN_DEPRECATED("Use HashFunction::create_or_throw")
102 inline std::unique_ptr<HashFunction> make_hash_function(const std::string& algo_spec,
103 const std::string& provider = "")
104 {
105 return HashFunction::create_or_throw(algo_spec, provider);
106 }
107
108 BOTAN_DEPRECATED("Use HashFunction::create")
109 inline HashFunction* get_hash(const std::string& algo_spec,
110 const std::string& provider = "")
111 {
112 return HashFunction::create(algo_spec, provider).release();
113 }
114
115 BOTAN_DEPRECATED("Use HashFunction::providers")
116 inline std::vector<std::string> get_hash_function_providers(const std::string& algo_spec)
117 {
118 return HashFunction::providers(algo_spec);
119 }
120
121 /**
122 * MAC factory method.
123 *
124 * @param algo_spec the name of the desired MAC
125 * @param provider the provider to use
126 * @return pointer to the MAC object
127 */
128 BOTAN_DEPRECATED("MessageAuthenticationCode::create")
129 inline MessageAuthenticationCode* get_mac(const std::string& algo_spec,
130 const std::string& provider = "")
131 {
132 return MessageAuthenticationCode::create(algo_spec, provider).release();
133 }
134
135 BOTAN_DEPRECATED("MessageAuthenticationCode::create_or_throw")
136 inline std::unique_ptr<MessageAuthenticationCode> make_message_auth(const std::string& algo_spec,
137 const std::string& provider = "")
138 {
139 return MessageAuthenticationCode::create(algo_spec, provider);
140 }
141
142 BOTAN_DEPRECATED("MessageAuthenticationCode::providers")
143 inline std::vector<std::string> get_mac_providers(const std::string& algo_spec)
144 {
145 return MessageAuthenticationCode::providers(algo_spec);
146 }
147
148 }
149
150 #endif
Botan::make_hash_function
std::unique_ptr< HashFunction > make_hash_function(const std::string &algo_spec, const std::string &provider="")
Definition: lookup.h:102
Botan::make_stream_cipher
std::unique_ptr< StreamCipher > make_stream_cipher(const std::string &algo_spec, const std::string &provider="")
Definition: lookup.h:75
Botan::MessageAuthenticationCode::create
static std::unique_ptr< MessageAuthenticationCode > create(const std::string &algo_spec, const std::string &provider="")
Definition: mac.cpp:43
Botan::HashFunction::create_or_throw
static std::unique_ptr< HashFunction > create_or_throw(const std::string &algo_spec, const std::string &provider="")
Definition: hash.cpp:303
Botan::get_hash_function_providers
std::vector< std::string > get_hash_function_providers(const std::string &algo_spec)
Definition: lookup.h:116
Botan::StreamCipher::create_or_throw
static std::unique_ptr< StreamCipher > create_or_throw(const std::string &algo_spec, const std::string &provider="")
Definition: stream_cipher.cpp:123
Botan::get_hash
HashFunction * get_hash(const std::string &algo_spec, const std::string &provider="")
Definition: lookup.h:109
Botan::get_block_cipher
BlockCipher * get_block_cipher(const std::string &algo_spec, const std::string &provider="")
Definition: lookup.h:41
std
Definition: bigint.h:619
Botan::get_mac_providers
std::vector< std::string > get_mac_providers(const std::string &algo_spec)
Definition: lookup.h:143
Botan::make_message_auth
std::unique_ptr< MessageAuthenticationCode > make_message_auth(const std::string &algo_spec, const std::string &provider="")
Definition: lookup.h:136
Botan::MessageAuthenticationCode
Definition: mac.h:20
Botan::get_block_cipher_providers
std::vector< std::string > get_block_cipher_providers(const std::string &algo_spec)
Definition: lookup.h:55
Botan::MessageAuthenticationCode::providers
static std::vector< std::string > providers(const std::string &algo_spec)
Definition: mac.cpp:131
Botan::BlockCipher::providers
static std::vector< std::string > providers(const std::string &algo_spec)
Definition: block_cipher.cpp:295
Botan::get_stream_cipher_providers
std::vector< std::string > get_stream_cipher_providers(const std::string &algo_spec)
Definition: lookup.h:82
Botan::BOTAN_DEPRECATED
class BOTAN_DLL BOTAN_DEPRECATED("LibraryInitializer is no longer required") LibraryInitializer
Definition: init.h:22
Botan::StreamCipher
Definition: stream_cipher.h:19
Botan::make_block_cipher
std::unique_ptr< BlockCipher > make_block_cipher(const std::string &algo_spec, const std::string &provider="")
Definition: lookup.h:48
Botan::get_stream_cipher
StreamCipher * get_stream_cipher(const std::string &algo_spec, const std::string &provider="")
Definition: lookup.h:68
Botan::HashFunction::create
static std::unique_ptr< HashFunction > create(const std::string &algo_spec, const std::string &provider="")
Definition: hash.cpp:93
Botan::HashFunction::providers
static std::vector< std::string > providers(const std::string &algo_spec)
Definition: hash.cpp:313
Botan
Definition: alg_id.cpp:13
Botan::StreamCipher::providers
static std::vector< std::string > providers(const std::string &algo_spec)
Definition: stream_cipher.cpp:133
Botan::BlockCipher::create_or_throw
static std::unique_ptr< BlockCipher > create_or_throw(const std::string &algo_spec, const std::string &provider="")
Definition: block_cipher.cpp:285
Botan::BlockCipher::create
static std::unique_ptr< BlockCipher > create(const std::string &algo_spec, const std::string &provider="")
Definition: block_cipher.cpp:88
Botan::HashFunction
Definition: hash.h:19
Botan::get_mac
MessageAuthenticationCode * get_mac(const std::string &algo_spec, const std::string &provider="")
Definition: lookup.h:129
Botan::StreamCipher::create
static std::unique_ptr< StreamCipher > create(const std::string &algo_spec, const std::string &provider="")
Definition: stream_cipher.cpp:41
Botan::BlockCipher
Definition: block_cipher.h:19
Botan::get_hash_function
HashFunction * get_hash_function(const std::string &algo_spec, const std::string &provider="")
Definition: lookup.h:95