summaryrefslogtreecommitdiff
path: root/lib/Crypto/Hash/HMAC.py
diff options
context:
space:
mode:
authorDwayne C. Litzenberger <dlitz@dlitz.net>2011-10-10 14:51:07 -0400
committerDwayne C. Litzenberger <dlitz@dlitz.net>2011-10-10 14:51:07 -0400
commitbf38995ffa51e28b8232e9417b450a8edbd23dec (patch)
tree7dfa5ffa862d9b47a97c19a027e6673e1567c4c6 /lib/Crypto/Hash/HMAC.py
parentb5cd39f31bd34598e4b166db83328d71ca2b7b33 (diff)
parent9cfb332b22e38b9d965bfb691eca67b6b8fa64e3 (diff)
downloadpycrypto-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.py8
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