(long)(after.tms_cutime - before.tms_cutime),
(long)(after.tms_cstime - before.tms_cstime));
-#ifdef CRC32_SHIFT4
- times(&before);
- for (i = 0; i < nblk; i++) {
- cksum = 0;
- mit_crc32_shift4(block + i * blksiz, blksiz, &cksum);
- }
- times(&after);
- printf("shift-4 implementation, %d blocks of %d bytes:\n",
- nblk, blksiz);
- printf("\tu=%ld s=%ld cu=%ld cs=%ld\n",
- (long)(after.tms_utime - before.tms_utime),
- (long)(after.tms_stime - before.tms_stime),
- (long)(after.tms_cutime - before.tms_cutime),
- (long)(after.tms_cstime - before.tms_cstime));
-#endif
free(block);
}
void
mit_crc32 (krb5_pointer in, size_t in_length, unsigned long *c);
-#ifdef CRC32_SHIFT4
-void mit_crc32_shift4(krb5_pointer /* in */,
- size_t /* in_length */,
- unsigned long * /* cksum */);
-#endif
-
#endif /* KRB5_CRC32__ */
*cksum = c;
}
-
-#ifdef CRC32_SHIFT4
-static unsigned long const tbl4[16] = {
- 0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac,
- 0x76dc4190, 0x6b6b51f4, 0x4db26158, 0x5005713c,
- 0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c,
- 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c
-};
-
-void
-mit_crc32_shift4(krb5_pointer in, size_t in_length, unsigned long *cksum)
-{
- register unsigned char *data, b;
- register unsigned long c = *cksum;
- size_t i;
-
- data = (u_char *)in;
- for (i = 0; i < in_length; i++) {
- b = data[i];
- c = (c >> 4) ^ tbl4[(b ^ c) & 0x0f];
- b >>= 4;
- c = (c >> 4) ^ tbl4[(b ^ c) & 0x0f];
- }
- *cksum = c;
-}
-#endif