diff options
author | Dwayne Litzenberger <dlitz@dlitz.net> | 2013-02-16 16:06:32 -0800 |
---|---|---|
committer | Dwayne Litzenberger <dlitz@dlitz.net> | 2013-02-16 16:20:23 -0800 |
commit | 755375bb7d866a01e19153f5809772f4474eb94d (patch) | |
tree | b8abee5c8e7c529330cfe371a318075df2a86b28 /pct-speedtest.py | |
parent | 7f5b9415346ea5849e8f6becbafcef8a48cf1b8f (diff) | |
download | pycrypto-755375bb7d866a01e19153f5809772f4474eb94d.tar.gz |
Hash: Rename SHA->SHA1 and RIPEMD->RIPEMD160 (1/2)
These algorithm names were confusing, because there are actually
algorithms called "SHA" (a.k.a. SHA-0) and "RIPEMD" (the original
version).
This commit just renames the modules, with no backward-compatibility
support.
Diffstat (limited to 'pct-speedtest.py')
-rw-r--r-- | pct-speedtest.py | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/pct-speedtest.py b/pct-speedtest.py index fe52a55..eb2778f 100644 --- a/pct-speedtest.py +++ b/pct-speedtest.py @@ -32,9 +32,14 @@ from Crypto.Cipher import AES, ARC2, ARC4, Blowfish, CAST, DES3, DES, XOR from Crypto.Hash import HMAC, MD2, MD4, MD5, SHA, SHA224, SHA256, SHA384, SHA512 from Crypto.Random import get_random_bytes try: - from Crypto.Hash import RIPEMD -except ImportError: # Some builds of PyCrypto don't have the RIPEMD module - RIPEMD = None + from Crypto.Hash import RIPEMD160 +except ImportError: + # Maybe it's called RIPEMD + try: + from Crypto.Hash import RIPEMD as RIPEMD160 + except ImportError: + # Some builds of PyCrypto don't have the RIPEMD module + RIPEMD160 = None try: import hashlib @@ -222,8 +227,8 @@ class Benchmark: ("SHA384", SHA384), ("SHA512", SHA512), ] - if RIPEMD is not None: - hash_specs += [("RIPEMD", RIPEMD)] + if RIPEMD160 is not None: + hash_specs += [("RIPEMD160", RIPEMD160)] hashlib_specs = [] if hashlib is not None: |