Botan  1.11.15
src/lib/mac/mac_utils.h
Go to the documentation of this file.
00001 /*
00002 * Authentication Code 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_MAC_UTILS_H__
00009 #define BOTAN_MAC_UTILS_H__
00010 
00011 #include <botan/internal/algo_registry.h>
00012 #include <botan/internal/xor_buf.h>
00013 #include <botan/loadstor.h>
00014 #include <botan/rotate.h>
00015 #include <algorithm>
00016 
00017 namespace Botan {
00018 
00019 #define BOTAN_REGISTER_MAC(name, maker) BOTAN_REGISTER_T(MessageAuthenticationCode, name, maker)
00020 #define BOTAN_REGISTER_MAC_NOARGS(name) BOTAN_REGISTER_T_NOARGS(MessageAuthenticationCode, name)
00021 
00022 #define BOTAN_REGISTER_MAC_1LEN(name, def) BOTAN_REGISTER_T_1LEN(MessageAuthenticationCode, name, def)
00023 
00024 #define BOTAN_REGISTER_MAC_NAMED_NOARGS(type, name) \
00025    BOTAN_REGISTER_NAMED_T(MessageAuthenticationCode, name, type, make_new_T<type>)
00026 
00027 #define BOTAN_REGISTER_MAC_NAMED_1LEN(type, name, def)                  \
00028    BOTAN_REGISTER_NAMED_T(MessageAuthenticationCode, name, type, (make_new_T_1len<type,def>))
00029 #define BOTAN_REGISTER_MAC_NAMED_1STR(type, name, def) \
00030    BOTAN_REGISTER_NAMED_T(MessageAuthenticationCode, name, type, \
00031                           std::bind(make_new_T_1str<type>, std::placeholders::_1, def));
00032 
00033 }
00034 
00035 #endif