]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Remove disabled md4 test code
authorKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>
Mon, 22 Feb 2010 21:23:20 +0000 (22:23 +0100)
committerKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>
Mon, 22 Feb 2010 22:02:22 +0000 (23:02 +0100)
This piece of test code was dead and in addition we don't have any framework for testing it. Any test of this module should probably be done upstream instead (Samba)

mdfour.c

index 581865b9b8fa387460e5768486660c81464b8cba..c3483f6eb2cd60eebffd3ac01a7b6c22b3067935 100644 (file)
--- a/mdfour.c
+++ b/mdfour.c
@@ -200,87 +200,3 @@ void mdfour(unsigned char *out, const unsigned char *in, int n)
        mdfour_update(&md, NULL, 0);
        mdfour_result(&md, out);
 }
-
-#ifdef TEST_MDFOUR
-static void file_checksum1(char *fname)
-{
-       int fd, i;
-       struct mdfour md;
-       unsigned char buf[1024], sum[16];
-       unsigned chunk;
-
-       fd = open(fname,O_RDONLY|O_BINARY);
-       if (fd == -1) {
-               perror("fname");
-               exit(1);
-       }
-
-       chunk = 1 + random() % (sizeof(buf) - 1);
-
-       mdfour_begin(&md);
-
-       while (1) {
-               int n = read(fd, buf, chunk);
-               if (n >= 0) {
-                       mdfour_update(&md, buf, n);
-               }
-               if (n < chunk) break;
-       }
-
-       close(fd);
-
-       mdfour_update(&md, NULL, 0);
-
-       mdfour_result(&md, sum);
-
-       for (i=0;i<16;i++)
-               printf("%02x", sum[i]);
-       printf("\n");
-}
-
-#if 0
-#include "../md4.h"
-
-static void file_checksum2(char *fname)
-{
-       int fd, i;
-       MDstruct md;
-       unsigned char buf[64], sum[16];
-
-       fd = open(fname,O_RDONLY|O_BINARY);
-       if (fd == -1) {
-               perror("fname");
-               exit(1);
-       }
-
-       MDbegin(&md);
-
-       while (1) {
-               int n = read(fd, buf, sizeof(buf));
-               if (n <= 0) break;
-               MDupdate(&md, buf, n*8);
-       }
-
-       if (!md.done) {
-               MDupdate(&md, buf, 0);
-       }
-
-       close(fd);
-
-       memcpy(sum, md.buffer, 16);
-
-       for (i=0;i<16;i++)
-               printf("%02x", sum[i]);
-       printf("\n");
-}
-#endif
-
-int main(int argc, char *argv[])
-{
-       file_checksum1(argv[1]);
-#if 0
-       file_checksum2(argv[1]);
-#endif
-       return 0;
-}
-#endif