libpldm: utils: Add crc8 implementation
Add crc8 implementation
Signed-off-by: George Liu <liuxiwei@inspur.com>
Change-Id: Icfa5e9815098783932d9234c71e6592127fd8273
diff --git a/libpldm/utils.h b/libpldm/utils.h
index 133fb4c..df5b62a 100644
--- a/libpldm/utils.h
+++ b/libpldm/utils.h
@@ -9,6 +9,15 @@
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
+
+/** @brief Compute Crc8(same as the one used by SMBUS)
+ *
+ * @param[in] data - Pointer to the target data
+ * @param[in] size - Size of the data
+ * @return The checksum
+ */
+uint8_t crc8(const void *data, size_t size);
+
/** @brief Compute Crc32(same as the one used by IEEE802.3)
*
* @param[in] data - Pointer to the target data