mirror of https://github.com/acidanthera/audk.git
MdePkg/BaseLib: Correct CRC-16-ANSI implementation
The ANSI implementation assumes that initial value should be 0xFFFF and
the result shouldn't be inverted
Fixes: 92288f4
("MdePkg/BaseLib: Add CRC16-ANSI and CRC32c implementations")
Signed-off-by: Savva Mitrofanov <savvamtr@gmail.com>
This commit is contained in:
parent
03d41cad62
commit
df8beba585
|
@ -678,13 +678,13 @@ CalculateCrc16Ansi (
|
|||
|
||||
Buf = Buffer;
|
||||
|
||||
Crc = ~InitialValue;
|
||||
Crc = InitialValue;
|
||||
|
||||
while (Length-- != 0) {
|
||||
Crc = mCrc16LookupTable[(Crc & 0xFF) ^ *(Buf++)] ^ (Crc >> 8);
|
||||
}
|
||||
|
||||
return ~Crc;
|
||||
return Crc;
|
||||
}
|
||||
|
||||
GLOBAL_REMOVE_IF_UNREFERENCED STATIC CONST UINT32 mCrc32cLookupTable[256] = {
|
||||
|
|
Loading…
Reference in New Issue