Merge pull request #2 from cojocar/patch-1

crc_be: bugfix: use only the last two bytes to index crc_table
This commit is contained in:
notwa 2013-11-15 16:21:33 -08:00
commit 38ec3b57d1
1 changed files with 1 additions and 1 deletions

View File

@ -42,7 +42,7 @@ void crc_fill_table(ulong *table, int big, ulong polynomial)
void crc_be_cycle(ulong *table, ulong *remainder, char c)
{
ulong byte = table[((*remainder) >> 24) ^ c];
ulong byte = table[(((*remainder) >> 24) ^ c) & 0xff];
*remainder = (((*remainder) << 8) ^ byte) & 0xFFFFFFFF;
}