1baa3858d3f5d128a5c8466b700098109edcad5f2repo sync/* XzCrc64.h -- CRC64 calculation 2baa3858d3f5d128a5c8466b700098109edcad5f2repo sync2010-04-16 : Igor Pavlov : Public domain */ 3baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 4baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#ifndef __XZ_CRC64_H 5baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#define __XZ_CRC64_H 6baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 7baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#include <stddef.h> 8baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 9baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#include "Types.h" 10baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 11baa3858d3f5d128a5c8466b700098109edcad5f2repo syncEXTERN_C_BEGIN 12baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 13baa3858d3f5d128a5c8466b700098109edcad5f2repo syncextern UInt64 g_Crc64Table[]; 14baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 15baa3858d3f5d128a5c8466b700098109edcad5f2repo syncvoid MY_FAST_CALL Crc64GenerateTable(void); 16baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 17baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#define CRC64_INIT_VAL UINT64_CONST(0xFFFFFFFFFFFFFFFF) 18baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#define CRC64_GET_DIGEST(crc) ((crc) ^ CRC64_INIT_VAL) 19baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#define CRC64_UPDATE_BYTE(crc, b) (g_Crc64Table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8)) 20baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 21baa3858d3f5d128a5c8466b700098109edcad5f2repo syncUInt64 MY_FAST_CALL Crc64Update(UInt64 crc, const void *data, size_t size); 22baa3858d3f5d128a5c8466b700098109edcad5f2repo syncUInt64 MY_FAST_CALL Crc64Calc(const void *data, size_t size); 23baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 24baa3858d3f5d128a5c8466b700098109edcad5f2repo syncEXTERN_C_END 25baa3858d3f5d128a5c8466b700098109edcad5f2repo sync 26baa3858d3f5d128a5c8466b700098109edcad5f2repo sync#endif 27