From 08c0a1ca2d7a4a0bf9e27dbaff409a3ffb9d2360 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Fri, 4 Dec 2009 14:54:57 +0000 Subject: [PATCH] Remove CRC32_SHIFT4 code as we are unlikely to ever need it git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23445 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/crypto/crypto_tests/t_crc.c | 15 --------------- src/lib/crypto/krb/crc32/crc-32.h | 6 ------ src/lib/crypto/krb/crc32/crc32.c | 26 -------------------------- 3 files changed, 47 deletions(-) diff --git a/src/lib/crypto/crypto_tests/t_crc.c b/src/lib/crypto/crypto_tests/t_crc.c index 69a646805..99b2b5ee7 100644 --- a/src/lib/crypto/crypto_tests/t_crc.c +++ b/src/lib/crypto/crypto_tests/t_crc.c @@ -134,21 +134,6 @@ timetest(unsigned int nblk, unsigned int blksiz) (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); } diff --git a/src/lib/crypto/krb/crc32/crc-32.h b/src/lib/crypto/krb/crc32/crc-32.h index 5c28b8b79..08fce6dc7 100644 --- a/src/lib/crypto/krb/crc32/crc-32.h +++ b/src/lib/crypto/krb/crc32/crc-32.h @@ -64,10 +64,4 @@ 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__ */ diff --git a/src/lib/crypto/krb/crc32/crc32.c b/src/lib/crypto/krb/crc32/crc32.c index ef364f3ed..659e61199 100644 --- a/src/lib/crypto/krb/crc32/crc32.c +++ b/src/lib/crypto/krb/crc32/crc32.c @@ -165,29 +165,3 @@ mit_crc32(krb5_pointer in, size_t in_length, unsigned long *cksum) *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 -- 2.26.2