15#ifndef PRIVACY_PROOFS_ZK_LIB_UTIL_CRC64_H_
16#define PRIVACY_PROOFS_ZK_LIB_UTIL_CRC64_H_
30static inline uint64_t shlu64(uint64_t x,
size_t n) {
31 return (n >= 64) ? 0u : (x << n);
33static inline uint64_t shru64(uint64_t x,
size_t n) {
34 return (n >= 64) ? 0u : (x >> n);
36static inline uint64_t update(uint64_t crc, uint64_t u,
size_t n = 64) {
38 uint64_t l = shlu64(crc, 127u - n) ^ shlu64(crc, 125u - n) ^
39 shlu64(crc, 124u - n) ^ shlu64(crc, 64u - n);
40 return shru64(crc, n) ^ l ^ (l >> 1) ^ (l >> 3) ^ (l >> 4);