Botan 2.19.5 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
14 BOTAN_FUTURE_INTERNAL_HEADER(crc24.h)
15
16namespace Botan {
17
18/**
19* 24-bit cyclic redundancy check
20*/
21 class BOTAN_PUBLIC_API(2,0) CRC24 final : public HashFunction
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
Botan::CRC24
Definition: crc24.h:22
Botan::CRC24::~CRC24
~CRC24()
Definition: crc24.h:32
Botan::CRC24::CRC24
CRC24()
Definition: crc24.h:31
Botan::CRC24::clone
HashFunction * clone() const override
Definition: crc24.h:26
Botan::CRC24::clear
void clear() override
Definition: crc24.h:29
Botan::CRC24::name
std::string name() const override
Definition: crc24.h:24
Botan::CRC24::output_length
size_t output_length() const override
Definition: crc24.h:25
Botan::HashFunction
Definition: hash.h:21
Botan::HashFunction::copy_state
virtual std::unique_ptr< HashFunction > copy_state() const =0
Botan::HashFunction::clear
virtual void clear()=0
final
int(* final)(unsigned char *, CTX *)
Definition: commoncrypto_hash.cpp:29
BOTAN_PUBLIC_API
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
BOTAN_FUTURE_INTERNAL_HEADER
#define BOTAN_FUTURE_INTERNAL_HEADER(hdr)
Definition: compiler.h:136
Botan
Definition: alg_id.cpp:13