Author: Martin Matusiak <numero...@gmail.com> Branch: py3.3-fixes3 Changeset: r72862:98b3c0bab1fe Date: 2014-08-17 20:14 +0200 http://bitbucket.org/pypy/pypy/changeset/98b3c0bab1fe/
Log: add .name attribute for all instances of shaXXX classes diff --git a/lib_pypy/_sha1.py b/lib_pypy/_sha1.py --- a/lib_pypy/_sha1.py +++ b/lib_pypy/_sha1.py @@ -123,6 +123,8 @@ def __init__(self): "Initialisation." + self.name = 'sha' + # Initial message length in bits(!). self.length = 0 self.count = [0, 0] @@ -349,6 +351,7 @@ """ crypto = sha() + crypto.name = 'sha1' if arg: crypto.update(arg) diff --git a/lib_pypy/_sha256.py b/lib_pypy/_sha256.py --- a/lib_pypy/_sha256.py +++ b/lib_pypy/_sha256.py @@ -208,6 +208,7 @@ block_size = SHA_BLOCKSIZE def __init__(self, s=None): + self.name = 'sha256' self._sha = sha_init() if s: sha_update(self._sha, s) @@ -230,6 +231,7 @@ digest_size = digestsize = 28 def __init__(self, s=None): + self.name = 'sha224' self._sha = sha224_init() if s: sha_update(self._sha, s) diff --git a/lib_pypy/_sha512.py b/lib_pypy/_sha512.py --- a/lib_pypy/_sha512.py +++ b/lib_pypy/_sha512.py @@ -236,6 +236,7 @@ block_size = SHA_BLOCKSIZE def __init__(self, s=None): + self.name = 'sha512' self._sha = sha_init() if s: sha_update(self._sha, s) @@ -258,6 +259,7 @@ digest_size = digestsize = 48 def __init__(self, s=None): + self.name = 'sha384' self._sha = sha384_init() if s: sha_update(self._sha, s) _______________________________________________ pypy-commit mailing list pypy-commit@python.org https://mail.python.org/mailman/listinfo/pypy-commit