Botan 3.3.0
Crypto and TLS for C&
gost_3411.h
Go to the documentation of this file.
1/*
2* GOST 34.11
3* (C) 2009 Jack Lloyd
4*
5* Botan is released under the Simplified BSD License (see license.txt)
6*/
7
8#ifndef BOTAN_GOST_3411_H_
9#define BOTAN_GOST_3411_H_
10
11#include <botan/hash.h>
12#include <botan/internal/alignment_buffer.h>
13#include <botan/internal/gost_28147.h>
14
15namespace Botan {
16
17/**
18* GOST 34.11
19*/
21 public:
22 std::string name() const override { return "GOST-R-34.11-94"; }
23
24 size_t output_length() const override { return 32; }
25
26 size_t hash_block_size() const override { return 32; }
27
28 std::unique_ptr<HashFunction> new_object() const override { return std::make_unique<GOST_34_11>(); }
29
30 std::unique_ptr<HashFunction> copy_state() const override;
31
32 void clear() override;
33
34 GOST_34_11();
35
36 private:
37 void compress_n(const uint8_t input[], size_t blocks);
38
39 void add_data(std::span<const uint8_t>) override;
40 void final_result(std::span<uint8_t>) override;
41
42 GOST_28147_89 m_cipher;
44 secure_vector<uint8_t> m_sum, m_hash;
45 uint64_t m_count;
46};
47
48} // namespace Botan
49
50#endif
Alignment buffer helper.
std::unique_ptr< HashFunction > copy_state() const override
Definition gost_3411.cpp:30
size_t hash_block_size() const override
Definition gost_3411.h:26
std::unique_ptr< HashFunction > new_object() const override
Definition gost_3411.h:28
void clear() override
Definition gost_3411.cpp:22
std::string name() const override
Definition gost_3411.h:22
size_t output_length() const override
Definition gost_3411.h:24
int(* final)(unsigned char *, CTX *)
std::vector< T, secure_allocator< T > > secure_vector
Definition secmem.h:61