From owner-cvs-src@FreeBSD.ORG Wed Mar 9 20:00:07 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C440A16A4CE; Wed, 9 Mar 2005 20:00:07 +0000 (GMT) Received: from pd4mo2so.prod.shaw.ca (shawidc-mo1.cg.shawcable.net [24.71.223.10]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8878B43D1D; Wed, 9 Mar 2005 20:00:07 +0000 (GMT) (envelope-from cperciva@freebsd.org) Received: from pd2mr7so.prod.shaw.ca (pd2mr7so-qfe3.prod.shaw.ca [10.0.141.10])2004)) with ESMTP id <0ID300JUCOW7TK90@l-daemon>; Wed, 09 Mar 2005 13:00:07 -0700 (MST) Received: from pn2ml5so.prod.shaw.ca ([10.0.121.149]) by pd2mr7so.prod.shaw.ca (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0ID300FPNOW78CE0@pd2mr7so.prod.shaw.ca>; Wed, 09 Mar 2005 13:00:07 -0700 (MST) Received: from [192.168.0.60] (S0106006067227a4a.vc.shawcable.net [24.87.209.6]) by l-daemon (iPlanet Messaging Server 5.2 HotFix 1.18 (built Jul 28 2003)) with ESMTP id <0ID30052AOW6G0@l-daemon>; Wed, 09 Mar 2005 13:00:06 -0700 (MST) Date: Wed, 09 Mar 2005 12:00:06 -0800 From: Colin Percival In-reply-to: <422F50A6.907@criticalmagic.com> To: Richard Coleman Message-id: <422F55C6.3000207@freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Accept-Language: en-us, en X-Enigmail-Version: 0.90.1.0 X-Enigmail-Supports: pgp-inline, pgp-mime References: <200503091923.j29JN4Ti063868@repoman.freebsd.org> <422F50A6.907@criticalmagic.com> User-Agent: Mozilla Thunderbird 1.0 (X11/20050302) cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/lib/libmd Makefile sha256.3 sha256.h sha256c.c shadriver.c src/sbin/md5 Makefile md5.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Mar 2005 20:00:07 -0000 Richard Coleman wrote: > Is there a reason that there are multiple versions of > md5/sha1/sha256/etc in the source tree? As far as I could tell, we didn't have sha256 in the tree until I added it. As for md5 and sha1, it's useful to have a minimalist libmd for applications which don't require the bloated monst^W^W^W OpenSSL, and these are small enough that a bit of duplication really doesn't matter. > It seems if these could be centralized, then it would be easier to have > assembly accelerated versions for each platform, or better yet to > utilize crypto hardware. I'd be surprised if you could find crypto hardware which could accelerate hashing -- the time it takes to send large amounts of data to a crypto processor would probably exceed the time it takes to perform the hashing on the host cpu. Assembly optimization might be worthwhile; but for this sort of code, I think you'd need to have a version optimized for each *processor* rather than each *platform* in order to get any significant gain. These hash functions are designed for 32-bit processors in a manner which makes it fairly hard for the compiler to get things wrong. Colin Percival