Re: HMAC_SHA1 does not match test vectors
Paul Lambert <[email protected]>
| Newsgroups | gmane.comp.python.cryptography |
|---|---|
| Message-ID | <[email protected]> |
oops ignore that last message, the HMAC_SHA1 should be: effcdf6ae5eb2fa2d27416d5f184df9c259a7c79 for the example I gave. The problem was in the document that I am reviewing. Thanks anyway :-) Paul > -----Original Message----- > From: Paul Lambert > Sent: Tuesday, May 14, 2002 8:34 PM > To: '[email protected]' > Subject: HMAC_SHA1 does not match test vectors > > > > Has anyone successfully tested the python hmac with > sha1? Looking at the built-in regression tests, it has only > been tested for md5. > > In using the HMAC_SHA1, I can not get the results to > match the published test vectors in RFC 2202 :-( > > For example: > > >>> import hmac > >>> import sha > >>> import md5 > >>> hm=hmac.new("Jefe","what do ya want for nothing?",sha) > >>> hm.hexdigest() > 'effcdf6ae5eb2fa2d27416d5f184df9c259a7c79' > > The actual result should be: > '750c783e6ab0b503eaa86e310a5db738' > > What's odd is that the hmac.py works fine for > md5 and matches all the test vectors. SHA1 seems to > have problems. > > Advice on how to get the correct test vector results > would be greatly appreciated. > > Regards, > > Paul >