Lines Matching full:crc
1 //===--- CRC.cpp - Cyclic Redundancy Check implementation -----------------===//
9 // This file contains implementations of CRC functions.
15 // See also Ross N. Williams "A Painless Guide to CRC Error Detection
21 #include "llvm/Support/CRC.h"
75 uint32_t llvm::crc32(uint32_t CRC, ArrayRef<uint8_t> Data) { in crc32() argument
76 CRC ^= 0xFFFFFFFFU; in crc32()
78 int TableIdx = (CRC ^ Byte) & 0xff; in crc32()
79 CRC = CRCTable[TableIdx] ^ (CRC >> 8); in crc32()
81 return CRC ^ 0xFFFFFFFFU; in crc32()
87 uint32_t llvm::crc32(uint32_t CRC, ArrayRef<uint8_t> Data) { in crc32() argument
93 CRC = ::crc32(CRC, (const Bytef *)Slice.data(), (uInt)Slice.size()); in crc32()
96 return CRC; in crc32()
104 CRC ^= 0xFFFFFFFFU; // Undo CRC-32 Init. in update()
105 CRC = crc32(CRC, Data); in update()
106 CRC ^= 0xFFFFFFFFU; // Undo CRC-32 XorOut. in update()