Botan  1.11.15
src/lib/block/block_utils.h
Go to the documentation of this file.
00001 /*
00002 * Block Cipher 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_BLOCK_CIPHER_UTILS_H__
00009 #define BOTAN_BLOCK_CIPHER_UTILS_H__
00010 
00011 #include <botan/block_cipher.h>
00012 #include <botan/internal/algo_registry.h>
00013 #include <botan/loadstor.h>
00014 #include <botan/rotate.h>
00015 #include <botan/internal/xor_buf.h>
00016 #include <algorithm>
00017 #include <functional>
00018 
00019 namespace Botan {
00020 
00021 #define BOTAN_REGISTER_BLOCK_CIPHER(name, maker) BOTAN_REGISTER_T(BlockCipher, name, maker)
00022 #define BOTAN_REGISTER_BLOCK_CIPHER_NOARGS(name) BOTAN_REGISTER_T_NOARGS(BlockCipher, name)
00023 
00024 #define BOTAN_REGISTER_BLOCK_CIPHER_1LEN(name, def) BOTAN_REGISTER_T_1LEN(BlockCipher, name, def)
00025 
00026 #define BOTAN_REGISTER_BLOCK_CIPHER_NAMED_NOARGS(type, name) BOTAN_REGISTER_NAMED_T(BlockCipher, name, type, make_new_T<type>)
00027 #define BOTAN_REGISTER_BLOCK_CIPHER_NAMED_1LEN(type, name, def) \
00028    BOTAN_REGISTER_NAMED_T(BlockCipher, name, type, (make_new_T_1len<type,def>))
00029 #define BOTAN_REGISTER_BLOCK_CIPHER_NAMED_1STR(type, name, def) \
00030    BOTAN_REGISTER_NAMED_T(BlockCipher, name, type, std::bind(make_new_T_1str<type>, std::placeholders::_1, def));
00031 
00032 #define BOTAN_REGISTER_BLOCK_CIPHER_NOARGS_IF(cond, type, name, provider, pref) \
00033    BOTAN_COND_REGISTER_NAMED_T_NOARGS(cond, BlockCipher, type, name, provider, pref)
00034 
00035 }
00036 
00037 #endif