Botan  2.13.0
Crypto and TLS for C++11
crc24.h
Go to the documentation of this file.
1 /*
2 * CRC24
3 * (C) 1999-2007 Jack Lloyd
4 * (C) 2017 [Ribose Inc](https://www.ribose.com). Performed by Krzysztof Kwiatkowski.
5 *
6 * Botan is released under the Simplified BSD License (see license.txt)
7 */
8 
9 #ifndef BOTAN_CRC24_H_
10 #define BOTAN_CRC24_H_
11 
12 #include <botan/hash.h>
13 
15 
16 namespace Botan {
17 
18 /**
19 * 24-bit cyclic redundancy check
20 */
22  {
23  public:
24  std::string name() const override { return "CRC24"; }
25  size_t output_length() const override { return 3; }
26  HashFunction* clone() const override { return new CRC24; }
27  std::unique_ptr<HashFunction> copy_state() const override;
28 
29  void clear() override { m_crc = 0XCE04B7L; }
30 
31  CRC24() { clear(); }
32  ~CRC24() { clear(); }
33  private:
34  void add_data(const uint8_t[], size_t) override;
35  void final_result(uint8_t[]) override;
36  uint32_t m_crc;
37  };
38 
39 }
40 
41 #endif
std::string name() const override
Definition: crc24.h:24
size_t output_length() const override
Definition: crc24.h:25
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
~CRC24()
Definition: crc24.h:32
void clear() override
Definition: crc24.h:29
HashFunction * clone() const override
Definition: crc24.h:26
Definition: alg_id.cpp:13
virtual void clear()=0
virtual std::unique_ptr< HashFunction > copy_state() const =0
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
Definition: compiler.h:139