hash/include/nil/crypto3/hash/md4.hpp
Go to the documentation of this file.
1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2018-2020 Mikhail Komarov <nemo@nil.foundation>
3 // Copyright (c) 2020 Nikita Kaskov <nbering@nil.foundation>
4 // Copyright (c) 2020 Alexander Sokolov <asokolov@nil.foundation>
5 //
6 // MIT License
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining a copy
9 // of this software and associated documentation files (the "Software"), to deal
10 // in the Software without restriction, including without limitation the rights
11 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12 // copies of the Software, and to permit persons to whom the Software is
13 // furnished to do so, subject to the following conditions:
14 //
15 // The above copyright notice and this permission notice shall be included in all
16 // copies or substantial portions of the Software.
17 //
18 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 // SOFTWARE.
25 //---------------------------------------------------------------------------//
26 
27 #ifndef CRYPTO3_HASH_MD4_HPP
28 #define CRYPTO3_HASH_MD4_HPP
29 
36 
37 namespace nil {
38  namespace crypto3 {
39  namespace hashes {
46  class md4 {
49 
50  public:
51  constexpr static const std::size_t word_bits = policy_type::word_bits;
53 
54  constexpr static const std::size_t block_bits = policy_type::block_bits;
55  constexpr static const std::size_t block_words = policy_type::block_words;
57 
58  constexpr static const std::size_t digest_bits = policy_type::digest_bits;
60 
61  struct construction {
62  struct params_type {
64 
65  constexpr static const std::size_t length_bits = policy_type::length_bits;
66  constexpr static const std::size_t digest_bits = policy_type::digest_bits;
67  };
68 
73  };
74 
75  template<typename StateAccumulator, std::size_t ValueBits>
77  struct params_type {
79 
80  constexpr static const std::size_t value_bits = ValueBits;
81  };
82 
84  };
85  };
86 
87  } // namespace hashes
88  } // namespace crypto3
89 } // namespace nil
90 
91 #endif // CRYPTO3_HASH_MD4_HPP
MD4 block cipher. Stands as a foundation for MD4 hashes.
Definition: block/include/nil/crypto3/block/md4.hpp:57
This will do the usual Merkle-Damgård-style strengthening, padding with a 1 bit, then 0 bits as neede...
Definition: hash/include/nil/crypto3/hash/detail/block_stream_processor.hpp:55
Definition: merkle_damgard_padding.hpp:39
MD4. Non-cryptographically secure checksum.
Definition: hash/include/nil/crypto3/hash/md4.hpp:46
policy_type::digest_type digest_type
Definition: hash/include/nil/crypto3/hash/md4.hpp:59
constexpr static const std::size_t digest_bits
Definition: hash/include/nil/crypto3/hash/md4.hpp:58
constexpr static const std::size_t word_bits
Definition: hash/include/nil/crypto3/hash/md4.hpp:51
constexpr static const std::size_t block_bits
Definition: hash/include/nil/crypto3/hash/md4.hpp:54
policy_type::block_type block_type
Definition: hash/include/nil/crypto3/hash/md4.hpp:56
constexpr static const std::size_t block_words
Definition: hash/include/nil/crypto3/hash/md4.hpp:55
policy_type::word_type word_type
Definition: hash/include/nil/crypto3/hash/md4.hpp:52
Definition: merkle_damgard_construction.hpp:55
Definition: block/include/nil/crypto3/detail/static_digest.hpp:72
Definition: pair.hpp:31
Definition: davies_meyer_compressor.hpp:44
Definition: hash/include/nil/crypto3/hash/detail/md4/md4_policy.hpp:58
Definition: hash/include/nil/crypto3/hash/detail/md4/md4_policy.hpp:37
block_cipher_type::key_type block_type
Definition: hash/include/nil/crypto3/hash/detail/md4/md4_policy.hpp:49
constexpr static const std::size_t digest_bits
Definition: hash/include/nil/crypto3/hash/detail/md4/md4_policy.hpp:55
block_cipher_type::word_type word_type
Definition: hash/include/nil/crypto3/hash/detail/md4/md4_policy.hpp:41
constexpr static const std::size_t length_bits
Definition: hash/include/nil/crypto3/hash/detail/md4/md4_policy.hpp:51
constexpr static const std::size_t word_bits
Definition: hash/include/nil/crypto3/hash/detail/md4/md4_policy.hpp:40
constexpr static const std::size_t block_bits
Definition: hash/include/nil/crypto3/hash/detail/md4/md4_policy.hpp:47
constexpr static const std::size_t block_words
Definition: hash/include/nil/crypto3/hash/detail/md4/md4_policy.hpp:48
Definition: hash/include/nil/crypto3/hash/md4.hpp:62
policy_type::digest_endian digest_endian
Definition: hash/include/nil/crypto3/hash/md4.hpp:63
constexpr static const std::size_t length_bits
Definition: hash/include/nil/crypto3/hash/md4.hpp:65
constexpr static const std::size_t digest_bits
Definition: hash/include/nil/crypto3/hash/md4.hpp:66
Definition: hash/include/nil/crypto3/hash/md4.hpp:61
merkle_damgard_construction< params_type, typename policy_type::iv_generator, davies_meyer_compressor< block_cipher_type, detail::state_adder >, detail::merkle_damgard_padding< policy_type > > type
Definition: hash/include/nil/crypto3/hash/md4.hpp:72
Definition: hash/include/nil/crypto3/hash/md4.hpp:77
policy_type::digest_endian digest_endian
Definition: hash/include/nil/crypto3/hash/md4.hpp:78
constexpr static const std::size_t value_bits
Definition: hash/include/nil/crypto3/hash/md4.hpp:80
Definition: hash/include/nil/crypto3/hash/md4.hpp:76
block_stream_processor< construction, StateAccumulator, params_type > type
Definition: hash/include/nil/crypto3/hash/md4.hpp:83
Definition: algebra/include/nil/crypto3/detail/stream_endian.hpp:45