aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/hash/checksum/crc32/crc32.h
diff options
context:
space:
mode:
authorlloyd <[email protected]>2015-02-05 07:44:25 +0000
committerlloyd <[email protected]>2015-02-05 07:44:25 +0000
commitcb0f83ae63c4555cbdd0607e3a5f6e9260c0d19c (patch)
tree4981027a25fa8074177b97c3a3ca7431f3337deb /src/lib/hash/checksum/crc32/crc32.h
parent2c14faf0aa1cfe0f8d70af1938dcad5b4d6d3b59 (diff)
Clean up root dir, remove some unneeded dependencies
Diffstat (limited to 'src/lib/hash/checksum/crc32/crc32.h')
-rw-r--r--src/lib/hash/checksum/crc32/crc32.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/lib/hash/checksum/crc32/crc32.h b/src/lib/hash/checksum/crc32/crc32.h
new file mode 100644
index 000000000..503b18b7a
--- /dev/null
+++ b/src/lib/hash/checksum/crc32/crc32.h
@@ -0,0 +1,37 @@
+/*
+* CRC32
+* (C) 1999-2007 Jack Lloyd
+*
+* Botan is released under the Simplified BSD License (see license.txt)
+*/
+
+#ifndef BOTAN_CRC32_H__
+#define BOTAN_CRC32_H__
+
+#include <botan/hash.h>
+
+namespace Botan {
+
+/**
+* 32-bit cyclic redundancy check
+*/
+class BOTAN_DLL CRC32 : public HashFunction
+ {
+ public:
+ std::string name() const { return "CRC32"; }
+ size_t output_length() const { return 4; }
+ HashFunction* clone() const { return new CRC32; }
+
+ void clear() { crc = 0xFFFFFFFF; }
+
+ CRC32() { clear(); }
+ ~CRC32() { clear(); }
+ private:
+ void add_data(const byte[], size_t);
+ void final_result(byte[]);
+ u32bit crc;
+ };
+
+}
+
+#endif