Botan 2.13.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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/gost_28147.h>
13
14 BOTAN_FUTURE_INTERNAL_HEADER(gost_3411.h)
15
16 namespace Botan {
17
18 /**
19 * GOST 34.11
20 */
21 class BOTAN_PUBLIC_API(2,0) GOST_34_11 final : public HashFunction
22 {
23 public:
24 std::string name() const override { return "GOST-R-34.11-94" ; }
25 size_t output_length() const override { return 32; }
26 size_t hash_block_size() const override { return 32; }
27 HashFunction* clone() const override { return new GOST_34_11; }
28 std::unique_ptr<HashFunction> copy_state() const override;
29
30 void clear() override;
31
32 GOST_34_11();
33 private:
34 void compress_n(const uint8_t input[], size_t blocks);
35
36 void add_data(const uint8_t[], size_t) override;
37 void final_result(uint8_t[]) override;
38
39 GOST_28147_89 m_cipher;
40 secure_vector<uint8_t> m_buffer, m_sum, m_hash;
41 size_t m_position;
42 uint64_t m_count;
43 };
44
45 }
46
47 #endif
m_cipher
CCCryptorRef m_cipher
Definition: commoncrypto_mode.cpp:50
Botan::GOST_28147_89
Definition: gost_28147.h:60
Botan::GOST_34_11::output_length
size_t output_length() const override
Definition: gost_3411.h:25
final
int(* final)(unsigned char *, CTX *)
Definition: commoncrypto_hash.cpp:28
BOTAN_PUBLIC_API
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
Botan::GOST_34_11
Definition: gost_3411.h:21
Botan::secure_vector
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:65
Botan::GOST_34_11::clone
HashFunction * clone() const override
Definition: gost_3411.h:27
Botan
Definition: alg_id.cpp:13
Botan::GOST_34_11::name
std::string name() const override
Definition: gost_3411.h:24
Botan::HashFunction
Definition: hash.h:20
Botan::HashFunction::clear
virtual void clear()=0
Botan::HashFunction::copy_state
virtual std::unique_ptr< HashFunction > copy_state() const =0
Botan::GOST_34_11::hash_block_size
size_t hash_block_size() const override
Definition: gost_3411.h:26
m_hash
std::unique_ptr< HashFunction > m_hash
Definition: tpm.cpp:446
BOTAN_FUTURE_INTERNAL_HEADER
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
Definition: compiler.h:139