• 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

75.0
/src/lib/hash/streebog/streebog.h
1
/*
2
* Streebog
3
* (C) 2017 Ribose Inc.
4
*
5
* Botan is released under the Simplified BSD License (see license.txt)
6
*/
7

8
#ifndef BOTAN_STREEBOG_H_
9
#define BOTAN_STREEBOG_H_
10

11
#include <botan/hash.h>
12

13
#include <botan/internal/alignment_buffer.h>
14

15
namespace Botan {
16

17
/**
18
* Streebog (GOST R 34.11-2012)
19
* RFC 6986
20
*/
21
class Streebog final : public HashFunction {
×
22
   public:
23
      size_t output_length() const override { return m_output_bits / 8; }
2,100✔
24

25
      std::unique_ptr<HashFunction> new_object() const override { return std::make_unique<Streebog>(m_output_bits); }
265✔
26

27
      void clear() override;
28
      std::string name() const override;
29

30
      size_t hash_block_size() const override { return 64; }
530✔
31

32
      std::unique_ptr<HashFunction> copy_state() const override;
33

34
      explicit Streebog(size_t output_bits);
35

36
   protected:
37
      void add_data(std::span<const uint8_t> input) override;
38
      void final_result(std::span<uint8_t> out) override;
39

40
      void compress(const uint8_t input[], bool lastblock = false);
41

42
      void compress_64(const uint64_t input[], bool lastblock = false);
43

44
   private:
45
      const size_t m_output_bits;
46
      uint64_t m_count;
47
      AlignmentBuffer<uint8_t, 64> m_buffer;
48
      secure_vector<uint64_t> m_h;
49
      secure_vector<uint64_t> m_S;
50
};
51

52
}  // namespace Botan
53

54
#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