Botan  1.11.15
src/lib/pk_pad/pad_utils.h
Go to the documentation of this file.
00001 /*
00002 * Public Key Padding Utility Header
00003 * (C) 2015 Jack Lloyd
00004 *
00005 * Botan is released under the Simplified BSD License (see license.txt)
00006 */
00007 
00008 #ifndef BOTAN_PK_PAD_UTILS_H__
00009 #define BOTAN_PK_PAD_UTILS_H__
00010 
00011 #include <botan/internal/algo_registry.h>
00012 #include <botan/hash_id.h>
00013 #include <botan/internal/xor_buf.h>
00014 #include <botan/loadstor.h>
00015 #include <algorithm>
00016 
00017 namespace Botan {
00018 
00019 #define BOTAN_REGISTER_EME(name, maker) BOTAN_REGISTER_T(EME, name, maker)
00020 #define BOTAN_REGISTER_EME_NOARGS(name) BOTAN_REGISTER_T_NOARGS(EME, name)
00021 
00022 #define BOTAN_REGISTER_EME_NAMED_NOARGS(type, name) \
00023    BOTAN_REGISTER_NAMED_T(EME, name, type, make_new_T<type>)
00024 
00025 #define BOTAN_REGISTER_EMSA_1HASH_1LEN(type, name)                    \
00026    BOTAN_REGISTER_NAMED_T(EMSA, name, type, (make_new_T_1X_1len<type, HashFunction>))
00027 
00028 #define BOTAN_REGISTER_EME_NAMED_1LEN(type, name, def)                  \
00029    BOTAN_REGISTER_NAMED_T(EME, name, type, (make_new_T_1len<type,def>))
00030 #define BOTAN_REGISTER_EME_NAMED_1STR(type, name, def) \
00031    BOTAN_REGISTER_NAMED_T(EME, name, type, \
00032                           std::bind(make_new_T_1str<type>, std::placeholders::_1, def));
00033 
00034 #define BOTAN_REGISTER_EMSA_NAMED_NOARGS(type, name) \
00035    BOTAN_REGISTER_NAMED_T(EMSA, name, type, make_new_T<type>)
00036 
00037 #define BOTAN_REGISTER_EMSA(name, maker) BOTAN_REGISTER_T(EMSA, name, maker)
00038 #define BOTAN_REGISTER_EMSA_NOARGS(name) BOTAN_REGISTER_T_NOARGS(EMSA, name)
00039 
00040 #define BOTAN_REGISTER_EMSA_1HASH(type, name)                    \
00041    BOTAN_REGISTER_NAMED_T(EMSA, name, type, (make_new_T_1X<type, HashFunction>))
00042 
00043 }
00044 
00045 #endif