summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* whitespaceDwayne Litzenberger2013-07-141-12/+12
|
* Remove pointless 'error' attribute from stream ciphersDwayne Litzenberger2013-07-141-6/+1
| | | | | Many years ago, this was removed from block_template, but not from stream_template.
* Add ABI check when importing _counter from block_templateDwayne Litzenberger2013-07-143-0/+26
|
* Counter: Deprecate disable_shortcut; Remove __PCT_CTR_SHORTCUT__ entirelyDwayne Litzenberger2013-07-143-22/+4
| | | | | | | | | | | | The `disable_shortcut` option served as a workaround in case `__PCT_CTR_SHORTCUT__` leaked through a wrapper object, but I don't think anyone actually used it, and it was a bad idea to expose it as part of the public API. Now that we do strong type checking inside block_template.c, there shoujld be no need to ever use this option. It's now a no-op, retained for backward compatibility only. It will be removed in some future version of PyCrypto.
* Fix MODE_CTR memory leak under Python 3Dwayne Litzenberger2013-07-142-18/+34
| | | | | | | | | The leak arose from the string creation in this line: PyObject_HasAttr(counter, PyUnicode_FromString("__PCT_CTR_SHORTCUT__")) This commit replaces the __PCT_CTR_SHORTCUT__ hack with code that imports the _counter module and checks the appropriate types.
* AES-NI support: Python 2.1 Backward compatibilityDwayne Litzenberger2013-04-211-1/+4
| | | | | - METH_NOARGS was introduced in Python 2.2. - Python 2.1 doesn't have True and False builtins.
* Remove unnecessary includesSebastian Ramacher2013-04-211-2/+0
|
* Initial AES-NI supportSebastian Ramacher2013-04-213-0/+336
|
* Add pycrypto_common.h and clean up a bunch of miscellaneous includes & typedefsDwayne Litzenberger2013-04-2127-118/+95
|
* Include inttypes.h or sys/inttypes.h based on what autoconf tells usDwayne Litzenberger2013-04-215-20/+26
| | | | | This should fix compilation on HP-UX 11.31. Thanks Adam Woodbeck for reporting this.
* Hash: Speed up initialization by removing pure-Python wrappershash-speedup-wipDwayne Litzenberger2013-02-178-36/+136
| | | | | | | | | | | | 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: Remove "oid" attributes; add "name" attributeDwayne Litzenberger2013-02-178-0/+11
| | | | | | | | | | | | 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.
* 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.
* 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.
* 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.
* setup.py: Add more compiler warnings and fix unsigned-signed comparisonsDwayne C. Litzenberger2012-07-032-4/+4
|
* _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
|
* _fastmath: Propagate errors raised in rabinMillerTestDwayne C. Litzenberger2012-07-031-3/+6
|
* 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.
* Fix block ciphers allowing empty string as IVDwayne C. Litzenberger2012-05-241-1/+1
| | | | Bug report: https://bugs.launchpad.net/pycrypto/+bug/997464
* In ALGnew, check the mode before checking other parametersDwayne C. Litzenberger2012-05-241-15/+15
|
* Removed PGP mode from block ciphersLegrandin2012-05-141-137/+9
|
* Add documentation for XOR cipherLegrandin2012-05-141-1/+1
|
* Added documentation for ARC4Legrandin2012-05-141-1/+1
|
* Added documentation for CAST-128Legrandin2012-05-121-1/+1
|
* Added documentation for RC2Legrandin2012-05-121-1/+1
|
* Added documentation for BlowfishLegrandin2012-05-111-1/+1
|
* Added documentation for Triple DES.Legrandin2012-05-101-1/+1
|
* Added documentation for AES and DES.Legrandin2012-05-102-2/+2
| | | | | | | A new module (blockalgo) has been added. It contains a class (BlockAlgo) all ciphers derive from. The only purpose of such base class is to centralize all general documentation applicable to all block ciphers (e.g. modes) into a single file.
* _fastmath: Convert negative numbers properlyDwayne C. Litzenberger2012-04-251-7/+18
|
* some commentsDwayne C. Litzenberger2012-04-251-1/+2
|
* _fastmath: missing Py_BLOCK_THREADS on isPrime(1)Dwayne C. Litzenberger2012-04-251-2/+5
| | | | | | | | | | When _fastmath is present, the following code caused the Python interpreter to abort with a fatal error: from Crypto.Util.number import isPrime isPrime(1) # Fatal Python error: PyEval_SaveThread: NULL tstate Bug report: https://bugs.launchpad.net/pycrypto/+bug/988431
* Fix segfault if Crypto.Random.new is missing for some reason.Dwayne C. Litzenberger2012-02-181-0/+5
| | | | | | | This should never happen, but we're already checking that Crypto.Random.new is callable, so we might as well also check that Crypto.Random.new exists. Also, fixing this should silence an (arguably false-positive) error emitted by cpychecker (a static analysis tool used by the Fedora project).
* Fix typoDwayne C. Litzenberger2012-02-181-1/+1
|
* Fix segfaults & reference leaks in error-handlingDwayne C. Litzenberger2012-02-181-10/+58
| | | | | | | | | | | | | | | | These bugs are likely only triggered during out-of-memory conditions. The bug report is at: https://bugs.launchpad.net/pycrypto/+bug/934294 These were found by Dave Malcolm's experimental static analysis tool: http://fedorapeople.org/~dmalcolm/gcc-python-plugin/2012-02-14/python-crypto-2.5-1.fc17/ See also: https://fedorahosted.org/gcc-python-plugin/ http://gcc-python-plugin.readthedocs.org/en/latest/cpychecker.html
* Fixed compilation error in MSVC.alsaan2011-11-291-7/+6
|
* Further fixed for python 3Legrandin2011-10-191-1/+2
|
* Merged from upstream (py3k support) and modified so that all unit tests pass.Legrandin2011-10-1817-206/+1152
|\
| * Fix build on Solaris 9 and earilerDwayne C. Litzenberger2011-10-104-3/+28
| | | | | | | | | | | | | | We use <sys/inttypes.h> on Solaris platforms that don't have <stdint.h>. This should fix https://bugs.launchpad.net/pycrypto/+bug/518871, reported by Sebastian Kayser.
| * Fix libgmp/libmpir autodetectionDwayne C. Litzenberger2011-10-103-5/+24
| |
| * Merge branch 'master' into py3kDwayne C. Litzenberger2011-10-109-10/+169
| |\ | | | | | | | | | | | | | | | Conflicts: setup.py src/_fastmath.c
| | * autoconf: only use side-channel secured mpz_powm_sec if it's available ↵Dwayne C. Litzenberger2011-10-103-9/+164
| | | | | | | | | | | | (libgmp 5 or later)
| * | Merge from dlitz/masterAnders Sundman2011-05-191-9/+9
| |\ \
| * | | Update documentation with current state of security of hash and cipherThorsten Behrens2011-01-021-0/+4
| | | | | | | | | | | | | | | | | | | | functions. Update documentation with Python 3.x notes.
| * | | Add Ron Rivet TestThorsten Behrens2010-12-302-6/+0
| | | | | | | | | | | | | | | | | | | | o Add Ron Rivet DES test to test_DES.py o Started on API documentation for 3.x
| * | | PY3K _fastmath supportThorsten Behrens2010-12-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o _fastmath now builds and runs on PY3K o Changes to setup.py to allow /usr/include for gmp.h o Changes to setup.py to allow linking fastmath w/ static mpir on Windows without warning messages o Changes to test_DSA/test_RSA to throw an exception if _fastmath is present but cannot be imported (due to an issue building _fastmath or the shared gmp/mpir libraries not being reachable) o number.py has the code to flag a failing _fastmath, but that code is commented out for a better runtime experience o Clean up the if for py21compat import - should have been == not is o Clean up some '== None' occurences, now 'is None' instead
| * | | PY3K support for _fastmath.c; removed floordiv(a,b) hack and replaced with ↵Thorsten Behrens2010-12-291-7/+8
| | | | | | | | | | | | | | | | divmod(a,b)[0]; move to assertEqual throughout the test suite to prep for assert_ and failIf being removed in 3.3/3.4