XzCrc64.h 615 B

1234567891011121314151617181920212223242526
  1. /* XzCrc64.h -- CRC64 calculation
  2. 2013-01-18 : Igor Pavlov : Public domain */
  3. #ifndef __XZ_CRC64_H
  4. #define __XZ_CRC64_H
  5. #include <stddef.h>
  6. #include "7zTypes.h"
  7. EXTERN_C_BEGIN
  8. extern UInt64 g_Crc64Table[];
  9. void MY_FAST_CALL Crc64GenerateTable(void);
  10. #define CRC64_INIT_VAL UINT64_CONST(0xFFFFFFFFFFFFFFFF)
  11. #define CRC64_GET_DIGEST(crc) ((crc) ^ CRC64_INIT_VAL)
  12. #define CRC64_UPDATE_BYTE(crc, b) (g_Crc64Table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8))
  13. UInt64 MY_FAST_CALL Crc64Update(UInt64 crc, const void *data, size_t size);
  14. UInt64 MY_FAST_CALL Crc64Calc(const void *data, size_t size);
  15. EXTERN_C_END
  16. #endif