Near Final PEP 247 - API for Cryptographic Hash Functions

Aahz Maruch aahz at panix.com
Fri Sep 28 11:14:36 EDT 2001


[posted to c.l.py; cc'd to Andrew]

In article <mailman.1001067421.5331.clpa-moderators at python.org>,
Andrew Kuchling  <akuchlin at mems-exchange.org> wrote:
>
>PEP 247 specifies a standard Python API for cryptographic hashing
>algorithms such as MD5 or SHA, to make it easier to switch between
>different implementations.  After a round of comments from the gang on
>the python-crypto list, I believe the PEP is complete, and am
>requesting one last round of comments on it.  The HTML version is at:
>
>    http://python.sourceforge.net/peps/pep-0247.html

I'm coming at this a bit late, but I've got some concerns that haven't
been raised by others:

Why is <module>.digest_size set to 0 if it is variable?  It should be
None or -1, with a strong preference for None.

I would like to see the argument for returning digest_size in bytes when
it is actually a bit string.  (Yes, I know the chance of having a
digest_size other than an integral number of bytes is nearly
infinitesimal -- OTOH, I've heard about weird new quantum algorithms, and
I don't know if they're restricted to multiples of 8.)

What exactly does update() do?  Does it replace or append?
-- 
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

We must not let the evil of a few trample the freedoms of the many.



More information about the Python-list mailing list