• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

randombit / botan / 6253464532

19 Sep 2023 12:06AM UTC coverage: 91.748% (+0.02%) from 91.726%
6253464532

push

github

web-flow
Merge pull request #3693 from Rohde-Schwarz/refactor/alignment_buffer

Refactor: AlignmentBuffer<> helper for block-oriented Hashes

79472 of 86620 relevant lines covered (91.75%)

8492168.28 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

80.0
/src/lib/hash/gost_3411/gost_3411.h
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

15
namespace Botan {
16

17
/**
18
* GOST 34.11
19
*/
20
class GOST_34_11 final : public HashFunction {
×
21
   public:
22
      std::string name() const override { return "GOST-R-34.11-94"; }
30✔
23

24
      size_t output_length() const override { return 32; }
79✔
25

26
      size_t hash_block_size() const override { return 32; }
20✔
27

28
      std::unique_ptr<HashFunction> new_object() const override { return std::make_unique<GOST_34_11>(); }
10✔
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;
43
      AlignmentBuffer<uint8_t, 32> m_buffer;
44
      secure_vector<uint8_t> m_sum, m_hash;
45
      uint64_t m_count;
46
};
47

48
}  // namespace Botan
49

50
#endif
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc