diff options
| author | Dwayne C. Litzenberger <dlitz@dlitz.net> | 2011-10-10 14:51:07 -0400 |
|---|---|---|
| committer | Dwayne C. Litzenberger <dlitz@dlitz.net> | 2011-10-10 14:51:07 -0400 |
| commit | bf38995ffa51e28b8232e9417b450a8edbd23dec (patch) | |
| tree | 7dfa5ffa862d9b47a97c19a027e6673e1567c4c6 /lib/Crypto/Hash/HMAC.py | |
| parent | b5cd39f31bd34598e4b166db83328d71ca2b7b33 (diff) | |
| parent | 9cfb332b22e38b9d965bfb691eca67b6b8fa64e3 (diff) | |
| download | pycrypto-bf38995ffa51e28b8232e9417b450a8edbd23dec.tar.gz | |
Merge branch 'master' into py3k
Conflicts:
setup.py
src/_fastmath.c
Diffstat (limited to 'lib/Crypto/Hash/HMAC.py')
| -rw-r--r-- | lib/Crypto/Hash/HMAC.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Crypto/Hash/HMAC.py b/lib/Crypto/Hash/HMAC.py index cbdf1bd..b09cb36 100644 --- a/lib/Crypto/Hash/HMAC.py +++ b/lib/Crypto/Hash/HMAC.py @@ -75,7 +75,13 @@ class HMAC: except AttributeError: self.digest_size = len(self.outer.digest()) - blocksize = 64 + try: + # The block size is 128 bytes for SHA384 and SHA512 and 64 bytes + # for the others hash function + blocksize = digestmod.block_size + except AttributeError: + blocksize = 64 + ipad = 0x36 opad = 0x5C |
