Coverage Report

Created: 2023-06-07 07:00

/src/botan/build/include/botan/internal/sm3.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
* SM3
3
* (C) 2017 Ribose Inc.
4
*
5
* Botan is released under the Simplified BSD License (see license.txt)
6
*/
7
8
#ifndef BOTAN_SM3_H_
9
#define BOTAN_SM3_H_
10
11
#include <botan/internal/mdx_hash.h>
12
13
namespace Botan {
14
15
/**
16
* SM3
17
*/
18
class SM3 final : public MDx_HashFunction {
19
   public:
20
0
      std::string name() const override { return "SM3"; }
21
22
0
      size_t output_length() const override { return 32; }
23
24
0
      std::unique_ptr<HashFunction> new_object() const override { return std::make_unique<SM3>(); }
25
26
      std::unique_ptr<HashFunction> copy_state() const override;
27
28
      void clear() override;
29
30
0
      SM3() : MDx_HashFunction(64, true, true), m_digest(32) { clear(); }
31
32
   private:
33
      void compress_n(const uint8_t[], size_t blocks) override;
34
      void copy_out(uint8_t[]) override;
35
36
      /**
37
      * The digest value
38
      */
39
      secure_vector<uint32_t> m_digest;
40
};
41
42
}  // namespace Botan
43
44
#endif