Remove CRC32_SHIFT4 code as we are unlikely to ever need it
authorGreg Hudson <ghudson@mit.edu>
Fri, 4 Dec 2009 14:54:57 +0000 (14:54 +0000)
committerGreg Hudson <ghudson@mit.edu>
Fri, 4 Dec 2009 14:54:57 +0000 (14:54 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@23445 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/crypto/crypto_tests/t_crc.c
src/lib/crypto/krb/crc32/crc-32.h
src/lib/crypto/krb/crc32/crc32.c

index 69a6468053dda30e3a283ac56953a5a9db62ec33..99b2b5ee7aa2bd955c6bd7f43c5ad929c4e5f275 100644 (file)
@@ -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);
 }
 
index 5c28b8b790288e4fe2a43c11233b365adc10bba1..08fce6dc761ad8af648b4486918b0cd27755f9bf 100644 (file)
 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__ */
index ef364f3ed9bbcf33874ba9d240d55b5a1b2d3ccf..659e61199ce406ce2936f5a012705d274434e09f 100644 (file)
@@ -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