Botan 3.5.0
Crypto and TLS for C&
whirlpool.h
Go to the documentation of this file.
1/*
2* Whirlpool
3* (C) 1999-2007 Jack Lloyd
4*
5* Botan is released under the Simplified BSD License (see license.txt)
6*/
7
8#ifndef BOTAN_WHIRLPOOL_H_
9#define BOTAN_WHIRLPOOL_H_
10
11#include <botan/internal/mdx_hash.h>
12
13namespace Botan {
14
15/**
16* Whirlpool
17*/
19 public:
21
24 static constexpr size_t block_bytes = 64;
25 static constexpr size_t output_bytes = 64;
26 static constexpr size_t ctr_bytes = 32;
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 "Whirlpool"; }
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
static constexpr MD_Endian bit_endianness
Definition whirlpool.h:23
std::unique_ptr< HashFunction > new_object() const override
static void compress_n(digest_type &digest, std::span< const uint8_t > input, size_t blocks)
Definition whirlpool.cpp:90
void clear() override
Definition whirlpool.h:42
secure_vector< uint64_t > digest_type
Definition whirlpool.h:20
std::unique_ptr< HashFunction > copy_state() const override
static constexpr size_t ctr_bytes
Definition whirlpool.h:26
static constexpr MD_Endian byte_endianness
Definition whirlpool.h:22
static constexpr size_t output_bytes
Definition whirlpool.h:25
size_t output_length() const override
Definition whirlpool.h:34
std::string name() const override
Definition whirlpool.h:32
static constexpr size_t block_bytes
Definition whirlpool.h:24
size_t hash_block_size() const override
Definition whirlpool.h:36
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