1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (c) 2013 Google, Inc
11 * crc8() - Calculate and return CRC-8 of the data
13 * This uses an x^8 + x^2 + x + 1 polynomial. A table-based algorithm would
14 * be faster, but for only a few bytes it isn't worth the code size
16 * @crc_start: CRC8 start value
17 * @vptr: Buffer to checksum
18 * @len: Length of buffer in bytes
19 * @return CRC8 checksum
21 unsigned int crc8(unsigned int crc_start, const unsigned char *vptr, int len);