COMMON: Fix crc calculation with reflected messages

This commit is contained in:
Vladimir Serbinenko 2022-11-27 02:43:24 +01:00 committed by Eugene Sandulenko
parent b63160a06e
commit c60281b3d0

View File

@ -235,7 +235,7 @@ T CRC<T>::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);
}