diff options
author | Hans Kristian Rosbach <hk-git@circlestorm.org> | 2019-09-17 14:12:15 +0200 |
---|---|---|
committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2019-09-20 22:29:21 +0200 |
commit | bc29c36ea5b52416a796ce065e017c438c98f338 (patch) | |
tree | 088c93e9aa5df86f880b99f4057b03e71a74245c /crc32_p.h | |
parent | 1e424d9bbf492f4e2454fbc0c8a7aa58834136e9 (diff) |
Add makecrct test and clean up makecrct.c code
Update crc32.h tables to match makecrct output.
Diffstat (limited to 'crc32_p.h')
-rw-r--r-- | crc32_p.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crc32_p.h b/crc32_p.h new file mode 100644 index 0000000..47b4b37 --- /dev/null +++ b/crc32_p.h @@ -0,0 +1,19 @@ +#ifndef CRC32_P_H_ +#define CRC32_P_H_ + +#define GF2_DIM 32 /* dimension of GF(2) vectors (length of CRC) */ + + +static inline uint32_t gf2_matrix_times(const uint32_t *mat, uint32_t vec) { + uint32_t sum = 0; + while (vec) { + if (vec & 1) + sum ^= *mat; + vec >>= 1; + mat++; + } + return sum; +} + + +#endif /* CRC32_P_H_ */ |