From c60281b3d0c9e7cb06fac482d1417f0a0d38e11d Mon Sep 17 00:00:00 2001 From: Vladimir Serbinenko Date: Sun, 27 Nov 2022 02:43:24 +0100 Subject: [PATCH] COMMON: Fix crc calculation with reflected messages --- common/crc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/crc.h b/common/crc.h index 0850f15ea03..47e78bf8860 100644 --- a/common/crc.h +++ b/common/crc.h @@ -235,7 +235,7 @@ T CRC::crcFast(byte const message[], int nBytes) { * Divide the message by the polynomial, a byte at a time. */ for (int b = 0; b < nBytes; ++b) { - byte data = reflectData(message[b] ^ (remainder >> (_width - 8))); + byte data = reflectData(message[b]) ^ (remainder >> (_width - 8)); remainder = _crcTable[data] ^ (remainder << 8); }