[New-bugs-announce] [issue6473] hmac sha384/sha512 fails test vectors

Iain Wade report at bugs.python.org
Mon Jul 13 05:56:51 CEST 2009

New submission from Iain Wade <iwade at optusnet.com.au>:

Test vectors are in the following draft rfc:

The problem is that hmac.py has a hard-coded block size of 64, while 
SHA-384 and SHA-512 have a 128-byte block size.

Suggested fix is either:

a/ have the various hashlib libraries export block size (like they 
currently do for digest_size).

b/ parameterize blocksize to the constructor so that users can override.

c/ I have no third suggestion.

I have made available a codified version of the test vectors for your 

components: Library (Lib)
files: test_vectors.py
messages: 90467
nosy: iwade
severity: normal
status: open
title: hmac sha384/sha512 fails test vectors
type: behavior
versions: Python 2.5
Added file: http://bugs.python.org/file14492/test_vectors.py

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list