summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorYegor Yefremov <yegorslists@googlemail.com>2016-05-25 09:51:13 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-05-25 10:41:30 +0200
commit61ddbd35207af8dbd9b1a0c17619148179235203 (patch)
tree5cabed596de7a799467f2571a610dd044adb1fd2 /include
parent57a648aabbb3e399cde3dcda749f8cb34b53b569 (diff)
downloadbarebox-61ddbd35207af8dbd9b1a0c17619148179235203.tar.gz
barebox-61ddbd35207af8dbd9b1a0c17619148179235203.tar.xz
crypto: add CRC32 digest
CRC32 digest can be used to check CRC32 hashes in FIT images etc. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/crypto/crc.h16
-rw-r--r--include/digest.h1
2 files changed, 17 insertions, 0 deletions
diff --git a/include/crypto/crc.h b/include/crypto/crc.h
new file mode 100644
index 0000000000..6428634d0a
--- /dev/null
+++ b/include/crypto/crc.h
@@ -0,0 +1,16 @@
+/*
+ * Common values for CRC algorithms
+ */
+
+#ifndef _CRYPTO_CRC_H
+#define _CRYPTO_CRC_H
+
+#include <linux/types.h>
+
+#define CRC32_DIGEST_SIZE 4
+
+struct crc32_state {
+ ulong crc;
+};
+
+#endif
diff --git a/include/digest.h b/include/digest.h
index fe30cc27e0..4552e58255 100644
--- a/include/digest.h
+++ b/include/digest.h
@@ -41,6 +41,7 @@ enum hash_algo {
HASH_ALGO_TGR_128,
HASH_ALGO_TGR_160,
HASH_ALGO_TGR_192,
+ HASH_ALGO_CRC32,
HASH_ALGO__LAST
};