Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:34199 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 54887 invoked by uid 1010); 21 Dec 2007 10:38:53 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 54872 invoked from network); 21 Dec 2007 10:38:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Dec 2007 10:38:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=helly@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=helly@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 85.214.94.56 as permitted sender) X-PHP-List-Original-Sender: helly@php.net X-Host-Fingerprint: 85.214.94.56 aixcept.net Linux 2.6 Received: from [85.214.94.56] ([85.214.94.56:35791] helo=h1149922.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 44/10-53466-CB79B674 for ; Fri, 21 Dec 2007 05:38:52 -0500 Received: from dhcp-172-28-204-176.zrh.corp.google.com (unknown [193.142.125.1]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by h1149922.serverkompetenz.net (Postfix) with ESMTP id 668971B352C; Fri, 21 Dec 2007 11:30:22 +0100 (CET) Date: Fri, 21 Dec 2007 11:30:21 +0100 Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <1258310140.20071221113021@marcus-boerger.de> To: Solar Designer CC: internals@lists.php.net In-Reply-To: <20071209010552.GA12561@openwall.com> References: <20071209010552.GA12561@openwall.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] faster & public domain MD5 implementation From: helly@php.net (Marcus Boerger) Hello Solar, thanks again for offering this. What we require is to have the PHP License in the code. If you are fine with this we will gladly replace the existing code with yours. You can of course put more header information in there to stress out further that it is your code and where it can be found. The key is that we indeed try to get rid of anything that is not under the PHP License. marcus Sunday, December 9, 2007, 2:05:52 AM, you wrote: > Hi, > Attached is a quick patch for PHP 5.2.5 that replaces RSA's copyrighted > implementation of MD5 with my public domain one: > > http://cvsweb.openwall.com/cgi/cvsweb.cgi/Owl/packages/popa3d/popa3d/md5/ > This also results in faster and slightly smaller code (both source and > binary). On a Pentium 3 that I've tested this on, the speedup is 12% > for the portable hashes as implemented in phpass: > http://www.openwall.com/phpass/ > Given that most CPU time is spent on various overhead of the PHP > interpreter rather than on MD5 hashing itself (and gprof confirms this), > the 12% speedup seen on the PHP script as a whole means that the speedup > for the MD5 implementation alone is much higher than that. The speedup > should be similar on other little-endian CPUs (other x86 CPUs, x86-64, > Alpha), but smaller on big-endian. > The code can be made cleaner by taking my md5.[ch] files as they are and > introducing two files more for PHP's added functions. I did not do it > for this patch in order for my changes to be less invasive. > I also did not similarly replace the MD5 implementation in hash_md.c, > which obviously will need to be done (once again, I'd prefer that > separate md5.[ch] files are used - and perhaps only one instance of them > included in the PHP distribution). > I also wrote a similar public domain implementation of MD4, which I can > provide for inclusion in hash_md.c if there's any interest. > Finally, it'd be nice if PHP could optionally link against OpenSSL > libcrypto to take advantage of the architecture-specific implementations > of these hashes. My implementations of MD5 and MD4 are function > prototype compatible with OpenSSL's. > I'd appreciate being CC'ed on any follow-ups as I am not on the list. > Thanks, Best regards, Marcus