[PYTHON-CRYPTO] hashlib - faster md5/sha, adds sha256/512 support

Gregory P. Smith greg at ELECTRICRAIN.COM
Wed Jun 15 10:03:53 CEST 2005


I sent this to python-dev but forgot to cc it here.  (no response so
far).  Anyways this proposes a hashlib module for a future python
standard library that sports md5, sha1, sha224-sha512 using openssl's
optimized implementations when available but including its own
(existing or libtomcrypt derived) otherwise so that all python
installations have the hashes available.

----- Forwarded message from "Gregory P. Smith" <greg at electricrain.com> -----

From: "Gregory P. Smith" <greg at electricrain.com>
Subject: [Python-Dev] hashlib - faster md5/sha, adds sha256/512 support
To: python-dev at python.org
Date: Sat, 11 Jun 2005 20:47:23 -0700

I have finished up the hashlib work I started on in feb/march for
patch 1121611 and 935454 after some discussion on this list.  The full
patch including tests and module documentation has been posted in the
sf patch 1121611 as hashlib-008.

I believe it is done and ready and would like to commit it after a
review.  Let the reviewing begin!

For easy viewing, here's what the module documentation looks like:

 http://electricrain.com/greg/hashlib-py25-doc/module-hashlib.html

The code is in the hashlib-008.patch file:  http://redirx.com/?3e19

hashlib incorporates both the 1121611 openssl hash support and the
935454 sha256+sha512 module support into a single hashlib module that
picks the fastest implementation of each algorithm to use.  OpenSSLs
implementations of md5 and sha1 are nearly 2x as fast as the existing
python builtin versions.  The (now legacy) md5 and sha modules are
turned into simple stubs that use hashlib.

The actual sourceforge patch tracker entries:

 https://sourceforge.net/tracker/?func=detail&aid=1121611&group_id=5470&atid=305470
 https://sourceforge.net/tracker/?func=detail&aid=935454&group_id=5470&atid=305470

Greg

----- End forwarded message -----





More information about the python-crypto mailing list