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