Botan  1.11.15
src/lib/base/lookup.h
Go to the documentation of this file.
00001 /*
00002 * Algorithm Lookup
00003 * (C) 1999-2007,2015 Jack Lloyd
00004 *
00005 * Botan is released under the Simplified BSD License (see license.txt)
00006 */
00007 
00008 #ifndef BOTAN_LOOKUP_H__
00009 #define BOTAN_LOOKUP_H__
00010 
00011 #include <botan/symkey.h>
00012 #include <string>
00013 
00014 namespace Botan {
00015 
00016 class BlockCipher;
00017 class StreamCipher;
00018 class HashFunction;
00019 class MessageAuthenticationCode;
00020 class PBKDF;
00021 
00022 /*
00023 * Get an algorithm object
00024 *  NOTE: these functions create and return new objects, letting the
00025 * caller assume ownership of them
00026 */
00027 
00028 /**
00029 * Block cipher factory method.
00030 *
00031 * @param algo_spec the name of the desired block cipher
00032 * @return pointer to the block cipher object
00033 */
00034 BOTAN_DLL BlockCipher* get_block_cipher(const std::string& algo_spec, const std::string& provider = "");
00035 
00036 BOTAN_DLL std::vector<std::string> get_block_cipher_providers(const std::string& algo_spec);
00037 
00038 /**
00039 * Stream cipher factory method.
00040 *
00041 * @param algo_spec the name of the desired stream cipher
00042 * @return pointer to the stream cipher object
00043 */
00044 BOTAN_DLL StreamCipher* get_stream_cipher(const std::string& algo_spec, const std::string& provider = "");
00045 
00046 BOTAN_DLL std::vector<std::string> get_stream_cipher_providers(const std::string& algo_spec);
00047 
00048 /**
00049 * Hash function factory method.
00050 *
00051 * @param algo_spec the name of the desired hash function
00052 * @return pointer to the hash function object
00053 */
00054 BOTAN_DLL HashFunction* get_hash_function(const std::string& algo_spec, const std::string& provider = "");
00055 
00056 inline HashFunction* get_hash(const std::string& algo_spec, const std::string& provider = "")
00057    {
00058    return get_hash_function(algo_spec, provider);
00059    }
00060 
00061 BOTAN_DLL std::vector<std::string> get_hash_function_providers(const std::string& algo_spec);
00062 
00063 /**
00064 * MAC factory method.
00065 *
00066 * @param algo_spec the name of the desired MAC
00067 * @return pointer to the MAC object
00068 */
00069 BOTAN_DLL MessageAuthenticationCode* get_mac(const std::string& algo_spec, const std::string& provider = "");
00070 
00071 BOTAN_DLL std::vector<std::string> get_mac_providers(const std::string& algo_spec);
00072 
00073 /**
00074 * Password based key derivation function factory method
00075 * @param algo_spec the name of the desired PBKDF algorithm
00076 * @return pointer to newly allocated object of that type
00077 */
00078 BOTAN_DLL PBKDF* get_pbkdf(const std::string& algo_spec, const std::string& provider = "");
00079 
00080 }
00081 
00082 #endif