This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author minrk
Recipients minrk
Date 2016-10-07.11:50:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1475841044.31.0.0614510494585.issue28384@psf.upfronthosting.co.za>
In-reply-to
Content
HMAC digest methods call inner.digest() with no arguments, but new-in-3.6 shake algorithms require a length argument.

possible solutions:

1. add optional length argument to HMAC.[hex]digest, and pass through to inner hash object
2. set hmac.digest_size, and use that to pass through to inner hash object if inner hash object has digest_size == 0
3. give shake hashers a default value for `length` in digest methods (logically 32 for shake_256, 16 for shake_128, I think)

test:

import hmac, hashlib

h = hmac.HMAC(b'secret', digestmod=hashlib.shake_256)
h.hexdigest() # raises on self.inner.digest() requires length argument
History
Date User Action Args
2016-10-07 11:50:44minrksetrecipients: + minrk
2016-10-07 11:50:44minrksetmessageid: <1475841044.31.0.0614510494585.issue28384@psf.upfronthosting.co.za>
2016-10-07 11:50:44minrklinkissue28384 messages
2016-10-07 11:50:44minrkcreate