/* Calculates the CRC16-ANSI checksum of the given buffer. */
UINT16 EFIAPI CalculateCrc16Ansi(IN CONST VOID *Buffer, IN UINTN Length, IN UINT16 InitialValue)
/* Calculates the CRC16-ANSI checksum of the given buffer. */
UINT16 EFIAPI CalculateCrc16Ansi(IN CONST VOID *Buffer, IN UINTN Length, IN UINT16 InitialValue)
{
  CONST UINT8  *Buf;
  UINT16       Crc;
  Buf = Buffer;
  Crc = InitialValue;
  while (Length-- != 0) {
    Crc = mCrc16LookupTable[(Crc & 0xFF) ^ *(Buf++)] ^ (Crc >> 8);
  }
  return Crc;
}