diff options
author | Dwayne Litzenberger <dlitz@dlitz.net> | 2013-02-17 11:21:38 -0800 |
---|---|---|
committer | Dwayne Litzenberger <dlitz@dlitz.net> | 2013-02-17 20:07:02 -0800 |
commit | fd398a28e3a227a539b264a9f1e11287b904c7da (patch) | |
tree | 9f1628ef88c17604f55ec0ad652b0e1fb3959f38 /setup.py | |
parent | 0d8ea5ff1607a3d7ae544667bff99229954484ff (diff) | |
download | pycrypto-fd398a28e3a227a539b264a9f1e11287b904c7da.tar.gz |
Hash: Speed up initialization by removing pure-Python wrappershash-speedup-wip
The pure Python wrappers around Crypto.Hash.* were convenient, but they
slowed down hash initialization by 4-7x.
There is a speed trade-off here: The MD5 and SHA1 objects are just
wrapped hashlib objects (or old-style md5/sha objects). To maintain API
compatibility with the rest of PyCrypto, we still have to wrap them, so
they're slower to initialize than the rest of the hash functions. If
hashlib ever adds a .new() method, we will automatically use hashlib
directly and gain the initialization speed-up.
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -399,25 +399,25 @@ kw = {'name':"pycrypto", sources=["src/_fastmath.c"]), # Hash functions - Extension("Crypto.Hash._MD2", + Extension("Crypto.Hash.MD2", include_dirs=['src/'], sources=["src/MD2.c"]), - Extension("Crypto.Hash._MD4", + Extension("Crypto.Hash.MD4", include_dirs=['src/'], sources=["src/MD4.c"]), - Extension("Crypto.Hash._SHA256", + Extension("Crypto.Hash.SHA256", include_dirs=['src/'], sources=["src/SHA256.c"]), - Extension("Crypto.Hash._SHA224", + Extension("Crypto.Hash.SHA224", include_dirs=['src/'], sources=["src/SHA224.c"]), - Extension("Crypto.Hash._SHA384", + Extension("Crypto.Hash.SHA384", include_dirs=['src/'], sources=["src/SHA384.c"]), - Extension("Crypto.Hash._SHA512", + Extension("Crypto.Hash.SHA512", include_dirs=['src/'], sources=["src/SHA512.c"]), - Extension("Crypto.Hash._RIPEMD160", + Extension("Crypto.Hash.RIPEMD160", include_dirs=['src/'], sources=["src/RIPEMD160.c"], define_macros=[endianness_macro()]), |