[Python-Dev] SHA-256 module

Trevor Perrin trevp at trevp.net
Tue Jun 29 11:55:08 EDT 2004


At 10:24 AM 6/29/2004 -0400, A.M. Kuchling wrote:
>Patch #935454 is a module implementing SHA-256, a variant of the
>160-bit SHA algorithm supported in Python's existing sha module.
[...]
>I don't want to do a
>detailed code review or require docs from the submitter if the module
>isn't likely to be included, so do we want to add this module?

Sorry about the lack of docs.  They'll be easy to copy-and-modify from the 
"sha" module, I'll try to get to that in a day or two.


>There are a bunch of other variants with different bit sizes such as
>512, 384, and 224 bits.  The only one likely to matter is SHA-512, so
>adding sha256 might mean that down the road we need to add a sha512
>module, too, but that seems unlikely.

I agree that SHA-512 is less important: it's much slower, and the security 
margin vs. SHA-256 is excessive.

However, a "hashes" package might make sense:

from hashes import md5
from hashes import sha
from hashes import sha256
...

At some future date, you could imagine a "ciphers" package with similar 
structure:

from ciphers import AES
from ciphers import DES3
...


Trevor 




More information about the Python-Dev mailing list