Botan 3.6.1
Crypto and TLS for C&
md4.h
Go to the documentation of this file.
1/*
2* MD4
3* (C) 1999-2007 Jack Lloyd
4*
5* Botan is released under the Simplified BSD License (see license.txt)
6*/
7
8#ifndef BOTAN_MD4_H_
9#define BOTAN_MD4_H_
10
11#include <botan/internal/mdx_hash.h>
12
13namespace Botan {
14
15/**
16* MD4
17*/
18class MD4 final : public HashFunction {
19 public:
21
24 static constexpr size_t block_bytes = 64;
25 static constexpr size_t output_bytes = 16;
26 static constexpr size_t ctr_bytes = 8;
27
28 static void compress_n(digest_type& digest, std::span<const uint8_t> input, size_t blocks);
29 static void init(digest_type& digest);
30
31 public:
32 std::string name() const override { return "MD4"; }
33
34 size_t output_length() const override { return output_bytes; }
35
36 size_t hash_block_size() const override { return block_bytes; }
37
38 std::unique_ptr<HashFunction> new_object() const override;
39
40 std::unique_ptr<HashFunction> copy_state() const override;
41
42 void clear() override { m_md.clear(); }
43
44 private:
45 void add_data(std::span<const uint8_t> input) override;
46
47 void final_result(std::span<uint8_t> output) override;
48
49 private:
51};
52
53} // namespace Botan
54
55#endif
size_t hash_block_size() const override
Definition md4.h:36
secure_vector< uint32_t > digest_type
Definition md4.h:20
size_t output_length() const override
Definition md4.h:34
static constexpr MD_Endian byte_endianness
Definition md4.h:22
static void compress_n(digest_type &digest, std::span< const uint8_t > input, size_t blocks)
Definition md4.cpp:77
static constexpr MD_Endian bit_endianness
Definition md4.h:23
void clear() override
Definition md4.h:42
std::string name() const override
Definition md4.h:32
static constexpr size_t ctr_bytes
Definition md4.h:26
std::unique_ptr< HashFunction > copy_state() const override
Definition md4.cpp:123
static constexpr size_t block_bytes
Definition md4.h:24
std::unique_ptr< HashFunction > new_object() const override
Definition md4.cpp:119
static constexpr size_t output_bytes
Definition md4.h:25
int(* init)(CTX *)
int(* final)(unsigned char *, CTX *)
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:61
MD_Endian
Definition mdx_hash.h:20