tiran / pysha3

Backport of hashlib.sha3 for 2.7 to 3.5

Home Page:https://docs.python.org/3/library/hashlib.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

keccak seems to be missing from package

MichaelJFlynn opened this issue · comments

In the readme:

  >>> import sha3
  >>> k = sha3.keccak_512()
  >>> k.update(b"data")
  >>> k.hexdigest()
'1065aceeded3a5e4412e2187e919bffeadf815f5bd73d37fe00d384fe29f55f08462fdabe1007b993ce5b8119630e7db93101d9425d6e352e22ffe3dcb56b825'

However, when I do this on my machine:

>>> import sha3
>>> k = sha3.keccak_512()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'keccak_512'

Also looking a dir(sha3) I see nothing with "keccak"

>>> dir(sha3)
['SHA3224', 'SHA3256', 'SHA3384', 'SHA3512', 'SHAKE128', 'SHAKE256', '_SHA3Base'\
, '_SHAKEBase', '__all__', '__author__', '__builtins__', '__doc__', '__file__', \
'__name__', '__package__', '__path__', '__version__', '_sha3', 'binascii', 'copy\
', 'hashlib', 'sha3_224', 'sha3_256', 'sha3_384', 'sha3_512', 'shake128', 'shake\
256']

This is all when installed via pip install pysha3

The output does not look like my pysha3 package with sha3. My packages does not have classes like _SHAKEBase.

$ python3.6 -m venv /tmp/sha3venv
$ /tmp/sha3venv/bin/pip install pysha3
Collecting pysha3
  Downloading pysha3-1.0.2.tar.gz (829kB)
    100% |████████████████████████████████| 829kB 1.5MB/s 
Installing collected packages: pysha3
  Running setup.py install for pysha3 ... done
Successfully installed pysha3-1.0.2
$ /tmp/sha3venv/bin/python
Python 3.6.1 (default, Jun 27 2017, 14:35:15) 
[GCC 7.1.1 20170622 (Red Hat 7.1.1-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sha3
>>> sha3.keccak_512()
<_pysha3.keccak_512 object at 0x7fdccf5b2cc8>
>>> dir(sha3)
['__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_hashlib', 'keccak_224', 'keccak_256', 'keccak_384', 'keccak_512', 'sha3_224', 'sha3_256', 'sha3_384', 'sha3_512', 'shake_128', 'shake_256']