summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Hash: Speed up initialization by removing pure-Python wrappershash-speedup-wipDwayne Litzenberger2013-02-1721-845/+274
| | | | | | | | | | | | 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.
* Hash: Generic Crypto.Hash.new(algo, [data]) functionDwayne Litzenberger2013-02-172-0/+154
| | | | | This allows us to instantiate a new hash given only an existing hash object.
* Hash: Remove "oid" attributes; add "name" attributeDwayne Litzenberger2013-02-1720-103/+92
| | | | | | | | | | | | In PyCrypto v2.5, the "oid" attribute was added to hash objects. In retrospect, this was not a good idea, since the OID is not really a property of the hash algorithm, it's a protocol-specific identifer for the hash functions. PKCS#1 v1.5 uses it, but other protocols (e.g. OpenPGP, DNSSEC, SSH, etc.) use different identifiers, and it doesn't make sense to add these to Crypto.Hash.* every time a new algorithm is added. This also has the benefit of being compatible with the Python standard library's "hashlib" objects, which also have a name attribute.
* Fix dumb typo: "is 2" should be "== 2"Dwayne Litzenberger2013-02-171-1/+1
|
* Counter: Fix compiler warning about signed-unsigned comparisonDwayne Litzenberger2013-02-172-1/+2
|
* Fix compiler warning about "_POSIX_C_SOURCE" being redefined in string.hDwayne Litzenberger2013-02-1713-12/+16
| | | | The solution is to include Python.h before string.h is included.
* pct-speedtest.py: Add PKCS#1 signing and verificationDwayne Litzenberger2013-02-171-0/+71
|
* Hash: Rename SHA->SHA1 and RIPEMD->RIPEMD160 (pct-speedtest.py)Dwayne Litzenberger2013-02-171-2/+7
| | | | Oops, I missed this one.
* Hash: Rename SHA->SHA1 and RIPEMD->RIPEMD160 (2/2)Dwayne Litzenberger2013-02-162-0/+48
| | | | | | | | | These algorithm names were confusing, because there are actually algorithms called "SHA" (a.k.a. SHA-0) and "RIPEMD" (the original version). This commit adds backward-compatibility support for the old Crypto.Hash.SHA and Crypto.Hash.RIPEMD modules.
* Hash: Rename SHA->SHA1 and RIPEMD->RIPEMD160 (1/2)Dwayne Litzenberger2013-02-1617-55/+60
| | | | | | | | | 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.
* We also support Python 3.3Dwayne Litzenberger2013-02-161-1/+1
|
* Tweak the READMEDwayne Litzenberger2013-02-161-0/+2
|
* OpenBSD: Automatically look for libgmp in /usr/localDwayne Litzenberger2013-02-164-0/+3411
|
* Use autoconf to generate compiler optionsDwayne Litzenberger2013-02-1614-137/+2942
| | | | | | | Hopefully this means we'll break on fewer platforms. Also, remove some of the extra optimization flags (e.g. -O3 -fomit-frame-pointer), which don't really do much.
* Fix RSA object serialization: Python 3 compatibilityDwayne Litzenberger2013-02-161-15/+21
|
* Fix RSA object serializationFrank Sievertsen2013-02-162-0/+62
|
* asn1: Python 2.1 compatibilityDwayne Litzenberger2013-02-161-0/+2
|
* Fix random.shuffle SelfTestDwayne Litzenberger2013-02-161-1/+1
| | | | | | random.shuffle("1") is a no-op, so it doesn't raise TypeError. This is now true of both the stdlib random.shuffle and PyCrypto's random.shuffle implementation.
* Fix LP#1061217: random.shuffle takes O(n^2) timeDwayne Litzenberger2013-02-161-7/+7
| | | | | | | | | | | The previous implementation took O(n**2) time and O(n) auxiliary space. We now use the Fisher-Yates algorithm, which takes O(n) time and O(1) space. Thanks to Sujay Jayakar and Andrew Cooke for pointing this out and suggesting a solution. Bug report: https://bugs.launchpad.net/pycrypto/+bug/1061217
* Fix leaks in _fastmathSebastian Ramacher2013-02-161-2/+3
| | | | | | | Fix leaks in getRandomInteger and rsaKeyNew. If randfunc throws an exception they both don't clean up properly. Thanks to Andreas Stührk for helping me to debug these two leaks.
* pct-speedtest.py: Test HMAC modulesDwayne Litzenberger2013-02-161-1/+23
|
* pct-speedtest.py: Add some commentsDwayne Litzenberger2013-02-161-0/+5
|
* pct-speedtest.py: Also test the standard hashlib modules, if possibleDwayne Litzenberger2013-02-161-8/+28
| | | | | On my machine, hashlib is about 5x faster than PyCrypto for single-block inputs. :( (It's about the same for long inputs.)
* pct-speedtest.py: Add tests for SHA224/SHA384/SHA512Dwayne Litzenberger2013-02-161-1/+4
|
* pct-speedtest.py: Python 3 compatibilityDwayne Litzenberger2013-02-161-4/+4
|
* pct-speedtest.py: Python 2.1-2.3 compatibilityDwayne Litzenberger2013-02-161-1/+8
| | | | They don't have os.urandom, so use Crypto.Random.get_random_bytes
* asn1: make DerObject into a new-style classDwayne Litzenberger2013-02-161-1/+1
|
* SHA2: Don't export symbol 'add_length'Dwayne Litzenberger2013-02-111-1/+1
| | | | | | Exporting symbols can cause symbol conflicts with external libraries, causing the dynamic linker to silently pick one of the implementations, which can lead to subtle bugs if they're actually different functions.
* Update tools/create-pythons.shDwayne Litzenberger2013-02-031-7/+11
|
* Use os.chmod instead of os.system("chmod ...")Sebastian Ramacher2013-02-021-2/+5
|
* Add build to TestCommand's sub_commandsSebastian Ramacher2013-02-021-0/+6
| | | | | | | | ... and run the sub_commands in TestCommand.run. So if python setup.py test is executed before ever running the build target, the extension modules are built. Bug: https://bugs.launchpad.net/pycrypto/+bug/1055256 Bug: https://bugs.launchpad.net/pycrypto/+bug/976171
* Check in some scripts I use for building and testing against multiple ↵Dwayne Litzenberger2013-02-023-0/+233
| | | | versions of Python
* Merge remote-tracking branch 'aried3r/master'Dwayne C. Litzenberger2012-07-031-3/+3
|\ | | | | | | Pull request: https://github.com/dlitz/pycrypto/pull/19
| * Using MODE_CBC instead of MODE_ECB in README exampleAnton Rieder2012-06-161-3/+3
| | | | | | | | | | | | | | | | | | ECB mode has known disadvantages and while the use of it could be intended, I think it would be a good idea to have a 'stronger' mode in the example. Thus, I adopted the example in the README to make use of MODE_CBC instead of MODE_ECB.
* | setup.py: Add more compiler warnings and fix unsigned-signed comparisonsDwayne C. Litzenberger2012-07-033-4/+9
| |
* | _fastmath: Replace 'long int' with 'long' to avoid confusionDwayne C. Litzenberger2012-07-031-12/+12
| | | | | | | | | | "long int" is equivalent to "long" in C, and it's harder to misread it as "int" this way.
* | _fastmath: Use default false_positive_prob is one is not specifiedDwayne C. Litzenberger2012-07-031-1/+1
| | | | | | | | This should never happen, but the behaviour is saner if it does.
* | Fix typo in commentDwayne C. Litzenberger2012-07-031-1/+1
| |
* | Merge branch 'error-propagation-fixes'Dwayne C. Litzenberger2012-07-032-5/+37
|\ \
| * | _fastmath: Propagate errors raised in rabinMillerTestDwayne C. Litzenberger2012-07-031-3/+6
| | |
| * | Merge remote-tracking branch 'sebastinas/clang' into error-propagation-fixesDwayne C. Litzenberger2012-07-031-2/+2
| |\ \ | | | | | | | | | | | | Pull request: https://github.com/dlitz/pycrypto/pull/23
| | * | Store result of rabinMillerTest in an int.Sebastian Ramacher2012-07-031-2/+2
| | | | | | | | | | | | | | | | | | | | rabinMillerTest returns an int but getStrongPrime stores the result in an unsigned long int which makes the tests in line 1545 and 1621 useless.
| * | | Add tests for error propagation in _fastmathDwayne C. Litzenberger2012-07-031-0/+29
|/ / / | | | | | | | | | | | | | | | | | | Affects isPrime and getStrongPrime. See https://github.com/dlitz/pycrypto/pull/23 ("Store result of rabinMillerTest in an int.") for the bug report.
* | | Run test_negative_number_roundtrip_mpzToLongObj_longObjToMPZ only if _fastmathSebastian Ramacher2012-06-281-1/+20
|/ / | | | | | | is available.
* | Added ARC4-drop[n] cipherLegrandin2012-06-202-0/+41
| |
* | Add test vectors for ARC4Legrandin2012-06-201-2/+358
| | | | | | | | | | Test vectors are taken from RFC 6229. All tests pass.
* | AES was 1 byte too long in exampleLegrandin2012-06-181-1/+1
| |
* | Examples for DES and DES3 were invertedLegrandin2012-06-112-9/+9
| |
* | Fixes to Counter module documentationLegrandin2012-06-102-3/+5
|/ | | | | | | The example code contained special character '\x00' that is directly shown by epydoc. Counter module was not included in __init__ of Crypto.Util
* Merge remote-tracking branch 'sebastinas/reenable-tests'Dwayne C. Litzenberger2012-05-284-14/+19
|\