Botan 2.19.3
Crypto and TLS for C&
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
16namespace 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
HashFunction * clone() const override
Definition crc24.h:26
void clear() override
Definition crc24.h:29
std::string name() const override
Definition crc24.h:24
size_t output_length() const override
Definition crc24.h:25
virtual std::unique_ptr< HashFunction > copy_state() const =0
virtual void clear()=0
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
Definition compiler.h:31
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
Definition compiler.h:136