[issue18742] Abstract base class for hashlib

2013-11-17 Thread Christian Heimes
Christian Heimes added the comment: Raymond: Good idea! to all: Do we need more discussion about the ABC, e.g. on the pycrypto mailing list? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18742

[issue18742] Abstract base class for hashlib

2013-11-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: Some comments: - AbstractCryptoHashFunction should be called CryptoHashBase or something (but does it warrant being public? I don't think so) - having Function in a class name is a bit confusing to me. Why not simply CryptoHash? - you don't need to add a

[issue18742] Abstract base class for hashlib

2013-11-17 Thread Christian Heimes
Christian Heimes added the comment: * Cryptographic Hash Function is the correct technical term for algorithms like SHA-1. http://en.wikipedia.org/wiki/Cryptographic_hash_function * PEP 452 is going to suggest that 3rd party libraries register their hash function as subclasses of the ABC. *

[issue18742] Abstract base class for hashlib

2013-11-17 Thread Antoine Pitrou
Antoine Pitrou added the comment: * Cryptographic Hash Function is the correct technical term for algorithms like SHA-1. Sure, but in a programming context, it's confusing when the function is implemented by a class with additional properties and methods. Why not simply CryptoHash? It sounds

[issue18742] Abstract base class for hashlib

2013-11-17 Thread Christian Heimes
Christian Heimes added the comment: It seems the name of the ABC needs more discussion. I'll address it in PEP 452 for Python 3.5. -- versions: +Python 3.5 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18742

[issue18742] Abstract base class for hashlib

2013-10-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset 72d7b2185771 by Christian Heimes in branch 'default': Issue #18742: Rework the internal hashlib construtor to pave the road for ABCs. http://hg.python.org/cpython/rev/72d7b2185771 -- nosy: +python-dev

[issue18742] Abstract base class for hashlib

2013-10-22 Thread Roundup Robot
Roundup Robot added the comment: New changeset 27da6e790c41 by Christian Heimes in branch 'default': Issue #18742: Expose the internal hash type object for ABCs. http://hg.python.org/cpython/rev/27da6e790c41 -- ___ Python tracker

[issue18742] Abstract base class for hashlib

2013-10-22 Thread Christian Heimes
Christian Heimes added the comment: I have checked in some of the basic and non-controversal parts of the PEP (optimization, expose type object). The ABCs are still missing. In order to cope with keyed and non-keyed CHF I have added a common base class for both and separate ABCs for keyed and

[issue18742] Abstract base class for hashlib

2013-10-22 Thread Gregory P. Smith
Gregory P. Smith added the comment: Have you had a chance to read http://www.python.org/dev/peps/pep-0452/ , too? Overall pep 452 looks good but one thing popped out at me: import hashlib from Crypto.Hash import MD5 m = MD5.new() isinstance(m,

[issue18742] Abstract base class for hashlib

2013-10-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Consider inheriting from abc.ABC rather than specifying metaclass=abc.ABCMeta -- nosy: +rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18742

[issue18742] Abstract base class for hashlib

2013-10-21 Thread Christian Heimes
Christian Heimes added the comment: I'm going to add CryptoKeyedHash ABC and register hmac as keyed hash algorithm, too. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18742 ___

[issue18742] Abstract base class for hashlib

2013-08-18 Thread Christian Heimes
Christian Heimes added the comment: Thanks Gregory! Have you had a chance to read http://www.python.org/dev/peps/pep-0452/ , too? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18742 ___

[issue18742] Abstract base class for hashlib

2013-08-15 Thread Christian Heimes
Christian Heimes added the comment: Updated patch. I'm going to add documentation when everybody is happy with the patch. -- nosy: +pitrou Added file: http://bugs.python.org/file31302/hashlib_abc2.patch ___ Python tracker rep...@bugs.python.org

[issue18742] Abstract base class for hashlib

2013-08-15 Thread Christian Heimes
Christian Heimes added the comment: Now with block_size -- Added file: http://bugs.python.org/file31308/hashlib_abc3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18742 ___

[issue18742] Abstract base class for hashlib

2013-08-15 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: Removed file: http://bugs.python.org/file31295/hashlib_abc.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18742 ___

[issue18742] Abstract base class for hashlib

2013-08-15 Thread Christian Heimes
Changes by Christian Heimes li...@cheimes.de: Removed file: http://bugs.python.org/file31302/hashlib_abc2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18742 ___

[issue18742] Abstract base class for hashlib

2013-08-15 Thread Gregory P. Smith
Gregory P. Smith added the comment: your patch makes sense to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18742 ___ ___ Python-bugs-list

[issue18742] Abstract base class for hashlib

2013-08-14 Thread Christian Heimes
New submission from Christian Heimes: All hashlib types provide a common interfaces but there is no common super class. The patch implements provides hashlib.CryptoHash abstract base class as common virtual class for all hash types. The patch also exposes all internal types of the internal