25 #ifndef CRYPTO3_TIGER_PADDING_HPP
26 #define CRYPTO3_TIGER_PADDING_HPP
28 #include <nil/crypto3/detail/inject.hpp>
29 #include <nil/crypto3/detail/pack.hpp>
30 #include <nil/crypto3/detail/octet.hpp>
36 template<
typename Hash>
38 typedef Hash policy_type;
40 typedef typename policy_type::digest_endian endian_type;
42 constexpr
static const std::size_t word_bits = policy_type::word_bits;
43 typedef typename policy_type::word_type word_type;
45 constexpr
static const std::size_t state_bits = policy_type::state_bits;
46 constexpr
static const std::size_t state_words = policy_type::state_words;
47 typedef typename policy_type::state_type state_type;
49 constexpr
static const std::size_t block_bits = policy_type::block_bits;
50 constexpr
static const std::size_t block_words = policy_type::block_words;
51 typedef typename policy_type::block_type block_type;
53 constexpr
static const std::size_t digest_bits = policy_type::digest_bits;
54 typedef typename policy_type::digest_type digest_type;
56 typedef ::nil::crypto3::detail::injector<endian_type, word_bits, block_words, block_bits>
63 block_type block_of_zeros;
64 std::size_t seen_copy = block_seen;
65 std::fill(block_of_zeros.begin(), block_of_zeros.end(), 0);
69 std::array<
octet_type, word_bits / octet_bits> bit_one = {{0x01}};
70 std::array<word_type, 1> bit_one_word {};
71 pack<stream_endian::big_octet_big_bit, endian_type, octet_bits, word_bits>(
72 bit_one.begin(), bit_one.end(), bit_one_word.begin());
Definition: tiger_padding.hpp:37
void operator()(block_type &block, std::size_t &block_seen)
Definition: tiger_padding.hpp:60
constexpr matrix< T, N, M > fill(T value)
generates a matrix containing a single value
Definition: matrix/utility.hpp:102
Definition: algebra/include/nil/crypto3/detail/make_array.hpp:33
boost::uint_t< octet_bits >::least octet_type
Definition: algebra/include/nil/crypto3/detail/octet.hpp:33
Definition: block/include/nil/crypto3/detail/inject.hpp:260
static void inject(const block_type &b_src, std::size_t b_src_seen, block_type &b_dst, std::size_t &b_dst_seen, std::size_t block_shift=0)
Definition: block/include/nil/crypto3/detail/inject.hpp:267