rlm@1: /* 7zCrc.h -- CRC32 calculation rlm@1: 2008-03-13 rlm@1: Igor Pavlov rlm@1: Public domain */ rlm@1: rlm@1: #ifndef __7Z_CRC_H rlm@1: #define __7Z_CRC_H rlm@1: rlm@1: #include rlm@1: rlm@1: #include "Types.h" rlm@1: rlm@1: extern UInt32 g_CrcTable[]; rlm@1: rlm@1: void MY_FAST_CALL CrcGenerateTable(void); rlm@1: rlm@1: #define CRC_INIT_VAL 0xFFFFFFFF rlm@1: #define CRC_GET_DIGEST(crc) ((crc) ^ 0xFFFFFFFF) rlm@1: #define CRC_UPDATE_BYTE(crc, b) (g_CrcTable[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8)) rlm@1: rlm@1: UInt32 MY_FAST_CALL CrcUpdate(UInt32 crc, const void *data, size_t size); rlm@1: UInt32 MY_FAST_CALL CrcCalc(const void *data, size_t size); rlm@1: rlm@1: #endif