src/third-party/lzma/XzCrc64.h (view raw)
1/* XzCrc64.h -- CRC64 calculation
22013-01-18 : Igor Pavlov : Public domain */
3
4#ifndef __XZ_CRC64_H
5#define __XZ_CRC64_H
6
7#include <stddef.h>
8
9#include "7zTypes.h"
10
11EXTERN_C_BEGIN
12
13extern UInt64 g_Crc64Table[];
14
15void MY_FAST_CALL Crc64GenerateTable(void);
16
17#define CRC64_INIT_VAL UINT64_CONST(0xFFFFFFFFFFFFFFFF)
18#define CRC64_GET_DIGEST(crc) ((crc) ^ CRC64_INIT_VAL)
19#define CRC64_UPDATE_BYTE(crc, b) (g_Crc64Table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
20
21UInt64 MY_FAST_CALL Crc64Update(UInt64 crc, const void *data, size_t size);
22UInt64 MY_FAST_CALL Crc64Calc(const void *data, size_t size);
23
24EXTERN_C_END
25
26#endif