summaryrefslogtreecommitdiff
path: root/firmware/2lib/include/2crc8.h
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2019-08-20 17:43:50 +0800
committerCommit Bot <commit-bot@chromium.org>2019-08-28 07:32:05 +0000
commit9adf2aa24307937380debb703ac07b8093a25f61 (patch)
treeb95c5bbb5259714ef86c125894267d0476cd62fe /firmware/2lib/include/2crc8.h
parenta762fa782793e7b13ba13ceed474f20c54afbdd3 (diff)
downloadvboot-9adf2aa24307937380debb703ac07b8093a25f61.tar.gz
vboot: fix up some headers, includes, comments, spacing
BUG=b:124141368 TEST=make clean && make runtests BRANCH=none Change-Id: Id97f544da845f7070555e5e8cc6e782b2d45c300 Signed-off-by: Joel Kitching <kitching@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1758151 Tested-by: Joel Kitching <kitching@chromium.org> Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'firmware/2lib/include/2crc8.h')
-rw-r--r--firmware/2lib/include/2crc8.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/firmware/2lib/include/2crc8.h b/firmware/2lib/include/2crc8.h
index f01eabd9..f9e0ccee 100644
--- a/firmware/2lib/include/2crc8.h
+++ b/firmware/2lib/include/2crc8.h
@@ -5,11 +5,17 @@
* Very simple 8-bit CRC function.
*/
-#ifndef VBOOT_REFERENCE_2_CRC8_H_
-#define VBOOT_REFERENCE_2_CRC8_H_
+#ifndef VBOOT_REFERENCE_2CRC8_H_
+#define VBOOT_REFERENCE_2CRC8_H_
+
+#include "2sysincludes.h"
/**
- * Calculate CRC-8 of the data, using x^8 + x^2 + x + 1 polynomial.
+ * Calculate CRC-8 of the data, using the ITU version.
+ *
+ * Calculate CRC-8 ITU version of the given buffer, using x^8 + x^2 + x + 1
+ * polynomial. Note that the CRC-8 will evaluate to zero for a buffer of all
+ * zeroes.
*
* @param data Data to CRC
* @param size Size of data in bytes
@@ -17,4 +23,4 @@
*/
uint8_t vb2_crc8(const void *data, uint32_t size);
-#endif /* VBOOT_REFERENCE_2_CRC8_H_ */
+#endif /* VBOOT_REFERENCE_2CRC8_H_ */