From 1a47e6d47c7184b116bb58e8451dc0d4f141a609 Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Tue, 12 Apr 2022 11:20:42 +0200 Subject: crc16: Move standard CRC-16 implementation from ubifs to lib MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This implementation provides standard CRC-16 algorithm with polynomial x^16 + x^15 + x^2 + 1. Signed-off-by: Pali Rohár Reviewed-by: Stefan Roese --- include/u-boot/crc.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/u-boot/crc.h b/include/u-boot/crc.h index eba8edfb4f3..5174bd7ac41 100644 --- a/include/u-boot/crc.h +++ b/include/u-boot/crc.h @@ -25,6 +25,9 @@ */ unsigned int crc8(unsigned int crc_start, const unsigned char *vptr, int len); +/* lib/crc16.c - 16 bit CRC with polynomial x^16 + x^15 + x^2 + 1 */ +uint16_t crc16(uint16_t crc, const unsigned char *buffer, size_t len); + /* lib/crc16-ccitt.c - 16 bit CRC with polynomial x^16+x^12+x^5+1 (CRC-CCITT) */ uint16_t crc16_ccitt(uint16_t crc_start, const unsigned char *s, int len); /** -- cgit v1.3.1