summaryrefslogtreecommitdiff
path: root/prototype/fw/src/crc32.h
diff options
context:
space:
mode:
authorjaseg <git@jaseg.de>2020-11-26 12:38:52 +0100
committerjaseg <git@jaseg.de>2020-11-26 12:38:52 +0100
commit451904a0c5fae3bd28d35c7128df3a9db1a04b26 (patch)
treeb406c126b08032219894db3ff16a2ccf87c667d6 /prototype/fw/src/crc32.h
parente282a5eb373ec4b44d36f580fe642483f2e52794 (diff)
downloadihsm-451904a0c5fae3bd28d35c7128df3a9db1a04b26.tar.gz
ihsm-451904a0c5fae3bd28d35c7128df3a9db1a04b26.tar.bz2
ihsm-451904a0c5fae3bd28d35c7128df3a9db1a04b26.zip
Add CRC32 implementation
Diffstat (limited to 'prototype/fw/src/crc32.h')
-rw-r--r--prototype/fw/src/crc32.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/prototype/fw/src/crc32.h b/prototype/fw/src/crc32.h
new file mode 100644
index 0000000..7a3a729
--- /dev/null
+++ b/prototype/fw/src/crc32.h
@@ -0,0 +1,12 @@
+#ifndef __CRC_32_H__
+#define __CRC_32_H__
+
+#include <stdint.h>
+
+typedef uint32_t crc32_t;
+
+inline static uint32_t crc32_reset() { return ~0; }
+uint32_t crc32_update(uint32_t old_state, uint8_t c);
+inline static uint32_t crc32_finalize(uint32_t state) { return ~state; }
+
+#endif /* __CRC_32_H__ */