Botan  2.11.0
Crypto and TLS for C++11
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 namespace Botan {
15 
16 /**
17 * GOST 34.11
18 */
19 class BOTAN_PUBLIC_API(2,0) GOST_34_11 final : public HashFunction
20  {
21  public:
22  std::string name() const override { return "GOST-R-34.11-94" ; }
23  size_t output_length() const override { return 32; }
24  size_t hash_block_size() const override { return 32; }
25  HashFunction* clone() const override { return new GOST_34_11; }
26  std::unique_ptr<HashFunction> copy_state() const override;
27 
28  void clear() override;
29 
30  GOST_34_11();
31  private:
32  void compress_n(const uint8_t input[], size_t blocks);
33 
34  void add_data(const uint8_t[], size_t) override;
35  void final_result(uint8_t[]) override;
36 
37  GOST_28147_89 m_cipher;
38  secure_vector<uint8_t> m_buffer, m_sum, m_hash;
39  size_t m_position;
40  uint64_t m_count;
41  };
42 
43 }
44 
45 #endif
size_t * output_length
Definition: ffi.h:280
int(* final)(unsigned char *, CTX *)
char * name
Definition: ffi.h:330
const uint8_t uint8_t size_t blocks
Definition: ffi.h:691
Definition: alg_id.cpp:13
class BOTAN_PUBLIC_API(2, 0) AlgorithmIdentifier final bool BOTAN_PUBLIC_API(2, 0) operator
Name Constraints.
Definition: asn1_obj.h:66
size_t const uint8_t input[]
Definition: base32.h:30