summaryrefslogtreecommitdiff
path: root/lib/Crypto/Cipher
diff options
context:
space:
mode:
authorDwayne Litzenberger <dlitz@dlitz.net>2013-04-21 20:18:15 -0700
committerDwayne Litzenberger <dlitz@dlitz.net>2013-04-21 20:41:18 -0700
commitcce74edc6c792efbe402eca681a7cead4836f543 (patch)
tree1b8df60558a598496f190a25c4e735f2359b7aa8 /lib/Crypto/Cipher
parentda01e9d8442b2aaf0dc69d93ac23b982b3288571 (diff)
downloadpycrypto-cce74edc6c792efbe402eca681a7cead4836f543.tar.gz
AES-NI support: Python 2.1 Backward compatibility
- METH_NOARGS was introduced in Python 2.2. - Python 2.1 doesn't have True and False builtins.
Diffstat (limited to 'lib/Crypto/Cipher')
-rw-r--r--lib/Crypto/Cipher/AES.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Crypto/Cipher/AES.py b/lib/Crypto/Cipher/AES.py
index 2aaaaa8..351b954 100644
--- a/lib/Crypto/Cipher/AES.py
+++ b/lib/Crypto/Cipher/AES.py
@@ -46,6 +46,9 @@ As an example, encryption can be done as follows:
__revision__ = "$Id$"
+import sys
+if sys.version_info[0] == 2 and sys.version_info[1] == 1:
+ from Crypto.Util.py21compat import *
from Crypto.Cipher import blockalgo
from Crypto.Cipher import _AES
from Crypto.Util import cpuid
@@ -69,7 +72,7 @@ class AESCipher (blockalgo.BlockAlgo):
# Check if the use_aesni was specified.
use_aesni = True
- if 'use_aesni' in kwargs:
+ if kwargs.has_key('use_aesni'):
use_aesni = kwargs['use_aesni']
del kwargs['use_aesni']