A few days ago, I wrote: > 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/
The code from phpass is now being used by phpBB3 (3.0.0 release) and WordPress (development). It is being considered for Drupal 7. Wouldn't it be nice for PHP to be more efficient when running those popular apps, and at the same time have cleaner and smaller code? Of course, it'd be great if PHP would also integrate the CRYPT_BLOWFISH code from Suhosin, but that can be discussed separately (if it needs a discussion). > 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. A correction: actually, Alpha falls into the same category with big-endian CPUs here (a smaller speedup - but nevertheless a speedup) because it lacks hardware support for unaligned accesses. I must have been too tired when I wrote the above. I am not quoting the rest of my posting, although I'd appreciate comments on the suggestions I had made there. Thanks, Alexander -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php