Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Mar 1999 15:08:22 -0500 (EST)
From:      shalunov@lynxhub.lz.att.com
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/10604: [PATCH] `md5 -t' too fast on modern CPUs
Message-ID:  <199903152008.PAA21615@tuzik.lz.att.com>

next in thread | raw e-mail | index | archive | help

>Number:         10604
>Category:       bin
>Synopsis:       [PATCH] `md5 -t' too fast on modern CPUs
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 15 13:10:00 PST 1999
>Closed-Date:
>Last-Modified:
>Originator:     stanislav shalunov
>Release:        FreeBSD 3.1-RELEASE i386
>Organization:
AT&T
>Environment:

FreeBSD tuzik.lz.att.com 3.1-RELEASE FreeBSD 3.1-RELEASE #0: Wed Mar 10 11:57:33 EST 1999     shalunov@tuzik.lz.att.com:/usr/src/sys/compile/TUZIK  i386

>Description:

	I am reporting two problems in one report, in fact.

	First, `md5 -t' by default digests 1000 1000-byte blocks
	and measures time in whole seconds.  On any modern CPU
	this operation certainly takes much less than 1 second,
	thus rendering the option useless.  I changed it in such
	a way that on my PII 350 it takes about 13-14 seconds.

	Second, the message ``Digesting...'' was not flushed, which
	made it useless, too (there is no newline in the end of
	message).

>How-To-Repeat:

	$ md5 -t

>Fix:
	
	Quick fix below:

--- md5.c~	Mon Mar 15 14:55:52 1999
+++ md5.c	Mon Mar 15 14:56:23 1999
@@ -34,8 +34,8 @@
 /*
  * Length of test block, number of test blocks.
  */
-#define TEST_BLOCK_LEN 1000
-#define TEST_BLOCK_COUNT 1000
+#define TEST_BLOCK_LEN 10000
+#define TEST_BLOCK_COUNT 50000
 
 static void MDString PROTO_LIST((char *));
 static void MDTimeTrial PROTO_LIST((void));
@@ -120,6 +120,7 @@
 	printf
 	    ("MD5 time trial. Digesting %d %d-byte blocks ...",
 	    TEST_BLOCK_COUNT, TEST_BLOCK_LEN);
+	fflush(stdout);
 
 	/* Initialize block */
 	for (i = 0; i < TEST_BLOCK_LEN; i++)


>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199903152008.PAA21615>