{"action":"closed","issue":{"url":"https://api.github.com/repos/Legrandin/pycryptodome/issues/4","labels_url":"https://api.github.com/repos/Legrandin/pycryptodome/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/Legrandin/pycryptodome/issues/4/comments","events_url":"https://api.github.com/repos/Legrandin/pycryptodome/issues/4/events","html_url":"https://github.com/Legrandin/pycryptodome/issues/4","id":114051481,"number":4,"title":"Crypto.Hash.keccak can't update() after calling digest()","user":{"login":"czepluch","id":1026799,"avatar_url":"https://avatars.githubusercontent.com/u/1026799?v=3","gravatar_id":"","url":"https://api.github.com/users/czepluch","html_url":"https://github.com/czepluch","followers_url":"https://api.github.com/users/czepluch/followers","following_url":"https://api.github.com/users/czepluch/following{/other_user}","gists_url":"https://api.github.com/users/czepluch/gists{/gist_id}","starred_url":"https://api.github.com/users/czepluch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/czepluch/subscriptions","organizations_url":"https://api.github.com/users/czepluch/orgs","repos_url":"https://api.github.com/users/czepluch/repos","events_url":"https://api.github.com/users/czepluch/events{/privacy}","received_events_url":"https://api.github.com/users/czepluch/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-29T13:40:21Z","updated_at":"2015-10-29T14:06:42Z","closed_at":"2015-10-29T14:06:42Z","body":"According to the the hashlib interface it should be possible to do the following:\r\n```python\r\nimport hashlib\r\ns = hashlib.sha256()\r\ns.update(\"foo\")\r\ns.digest()\r\ns.update(\"bar\")\r\ns.digest()\r\n```\r\nThis is however not possible with this library, but it would be very nice if it was.\r\nTrying the same with pycryptodome fails like this:\r\n```python\r\nfrom Crypto.Hash import keccak\r\nkh = keccak.new(digest_bits=256)\r\nkh.update(\"foo\")\r\nkh.update(\"bar\")\r\nkh.digest()\r\nkh.update(\"baz\")\r\n```\r\nGives this TypeError:\r\n>  File \"/home/czepluch/.virtualenvs/tmp-dab852443eeadef/site-packages/pycryptodome-3.3-py2.7-linux-x86_64.egg/Crypto/Hash/keccak.py\", line 111, in update\r\n >   raise TypeError(\"You can only call 'digest' or 'hexdigest' on this object\")\r\n>TypeError: You can only call 'digest' or 'hexdigest' on this object\r\n\r\nShouldn't pycryptodome follow the same interface as hashlib?"}}