aboutsummaryrefslogtreecommitdiffstats
path: root/include/lookup.h
blob: 6e0cecdc7a6e80a6a74d2a9f08966970c055919b (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*************************************************
* Algorithm Lookup Header File                   *
* (C) 1999-2007 Jack Lloyd                       *
*************************************************/

#ifndef BOTAN_LOOKUP_H__
#define BOTAN_LOOKUP_H__

#include <botan/base.h>
#include <botan/filters.h>
#include <botan/mode_pad.h>
#include <botan/pk_util.h>
#include <botan/s2k.h>

namespace Botan {

/*************************************************
* Retrieve an object from the lookup table       *
*************************************************/
BOTAN_DLL const BlockCipher* retrieve_block_cipher(const std::string&);
BOTAN_DLL const StreamCipher* retrieve_stream_cipher(const std::string&);
BOTAN_DLL const HashFunction* retrieve_hash(const std::string&);
BOTAN_DLL const MessageAuthenticationCode* retrieve_mac(const std::string&);
BOTAN_DLL const S2K* retrieve_s2k(const std::string&);

BOTAN_DLL const BlockCipherModePaddingMethod*
retrieve_bc_pad(const std::string&);

/*************************************************
* Get an algorithm object                        *
*************************************************/
BOTAN_DLL BlockCipher* get_block_cipher(const std::string&);
BOTAN_DLL StreamCipher* get_stream_cipher(const std::string&);
BOTAN_DLL HashFunction* get_hash(const std::string&);
BOTAN_DLL MessageAuthenticationCode* get_mac(const std::string&);
BOTAN_DLL S2K* get_s2k(const std::string&);
BOTAN_DLL const BlockCipherModePaddingMethod* get_bc_pad(const std::string&);

/*************************************************
* Get an EMSA/EME/KDF/MGF function               *
*************************************************/
BOTAN_DLL EME*  get_eme(const std::string&);
BOTAN_DLL EMSA* get_emsa(const std::string&);
BOTAN_DLL MGF*  get_mgf(const std::string&);
BOTAN_DLL KDF*  get_kdf(const std::string&);

/*************************************************
* Get a cipher object                            *
*************************************************/
BOTAN_DLL Keyed_Filter* get_cipher(const std::string&,
                                   const SymmetricKey&,
                                   const InitializationVector&,
                                   Cipher_Dir);

BOTAN_DLL Keyed_Filter* get_cipher(const std::string&,
                                   const SymmetricKey&,
                                   Cipher_Dir);

BOTAN_DLL Keyed_Filter* get_cipher(const std::string&, Cipher_Dir);

/*************************************************
* Check to see if an algorithm exists            *
*************************************************/
BOTAN_DLL bool have_algorithm(const std::string&);

BOTAN_DLL bool have_block_cipher(const std::string&);
BOTAN_DLL bool have_stream_cipher(const std::string&);
BOTAN_DLL bool have_hash(const std::string&);
BOTAN_DLL bool have_mac(const std::string&);

/*************************************************
* Dereference an alias                           *
*************************************************/
BOTAN_DLL std::string deref_alias(const std::string&);

/*************************************************
* Query information about an algorithm           *
*************************************************/
BOTAN_DLL u32bit block_size_of(const std::string&);
BOTAN_DLL u32bit output_length_of(const std::string&);

BOTAN_DLL bool valid_keylength_for(u32bit, const std::string&);
BOTAN_DLL u32bit min_keylength_of(const std::string&);
BOTAN_DLL u32bit max_keylength_of(const std::string&);
BOTAN_DLL u32bit keylength_multiple_of(const std::string&);

}

#endif