Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Merge pull request #62 (Fixes AESNI alignment bug) | Dwayne Litzenberger | 2014-02-22 | 1 | -0/+1 |
|\ | |||||
| * | Add block_finalize to clean up block_state from ALGdealloc | Sebastian Ramacher | 2013-10-28 | 1 | -0/+1 |
| | | | | | | | | | | | | This is the counterpart to block_init which is called from ALGnew. Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at> | ||||
* | | Throw exception when IV is used with ECB or CTR | Legrandin | 2014-02-21 | 1 | -0/+11 |
|/ | | | | | | | | | | | | The IV parameter is currently ignored when initializing a cipher in ECB or CTR mode. For CTR mode, it is confusing: it takes some time to see that a different parameter is needed (the counter). For ECB mode, it is outright dangerous. This patch forces an exception to be raised. | ||||
* | block_template: Fix compiler warning (%i -> %zi) | Dwayne Litzenberger | 2013-10-20 | 1 | -1/+1 |
| | | | | | | | | | | | This fixes this warning: In file included from src/CAST.c:453:0: src/block_template.c: In function ‘ALG_Encrypt’: src/block_template.c:426:12: warning: format ‘%i’ expects argument of type ‘int’, but argument 3 has type ‘Py_ssize_t’ [-Wformat=] ctr->buf_size, BLOCK_SIZE); ^ | ||||
* | Clarify message about incorrect length in the counter block. | Legrandin | 2013-10-20 | 1 | -2/+2 |
| | | | | | | When the counter function returns an incorrect counter block to the cipher in CTR mode, the error message includes both the required and the provided amount of data (in bytes). | ||||
* | Fixed MODE_OFB requiring padding | dev-jjc | 2013-07-14 | 1 | -20/+42 |
| | | | | | | Closes: https://bugs.launchpad.net/pycrypto/+bug/996193 Closes: https://github.com/dlitz/pycrypto/pull/26 [dlitz: Squashed and fixed whitespace.] | ||||
* | Improve C extension autodocs | Dwayne Litzenberger | 2013-07-14 | 1 | -0/+23 |
| | | | | | | | | - Add __all__ to C cipher & hash modules - Update hash module docstrings to document the block_size and digest_size variables. Closes: https://bugs.launchpad.net/pycrypto/+bug/1179255 | ||||
* | Py3k cleanup: bytes/string -> bytestring in error messages | Dwayne Litzenberger | 2013-07-14 | 1 | -15/+3 |
| | |||||
* | Py3k cleanup: Module initialization | Dwayne Litzenberger | 2013-07-14 | 1 | -26/+40 |
| | |||||
* | Py3k cleanup: Always use tp_getattro | Dwayne Litzenberger | 2013-07-14 | 1 | -32/+12 |
| | |||||
* | Py3k cleanup: PyMODINIT_FUNC | Dwayne Litzenberger | 2013-07-14 | 1 | -4/+0 |
| | |||||
* | Py3k cleanup: PyVarObject_HEAD_INIT | Dwayne Litzenberger | 2013-07-14 | 1 | -5/+0 |
| | |||||
* | Py3k cleanup: PyType_Ready | Dwayne Litzenberger | 2013-07-14 | 1 | -2/+3 |
| | |||||
* | Py3k cleanup: PyInt_CheckExact & PyInt_AS_LONG | Dwayne Litzenberger | 2013-07-14 | 1 | -11/+0 |
| | |||||
* | Py3k cleanup: staticforward and Py_TYPE | Dwayne Litzenberger | 2013-07-14 | 1 | -4/+2 |
| | |||||
* | Py3k cleanup: METH_O | Dwayne Litzenberger | 2013-07-14 | 1 | -5/+0 |
| | |||||
* | Py3k cleanup: PyModule_AddIntConstant | Dwayne Litzenberger | 2013-07-14 | 1 | -3/+0 |
| | |||||
* | Py3k cleanup: Remove unused is_ALGobject macro | Dwayne Litzenberger | 2013-07-14 | 1 | -2/+0 |
| | |||||
* | Py3k cleanup: Define PyInt_FromLong for Python 3.x and use it | Dwayne Litzenberger | 2013-07-14 | 1 | -4/+3 |
| | | | | | | This is the first of a series of changes that aims to reduce code duplication between the Python 3 and Python 2 versions of the C extensions. | ||||
* | Add ABI check when importing _counter from block_template | Dwayne Litzenberger | 2013-07-14 | 1 | -0/+14 |
| | |||||
* | Counter: Deprecate disable_shortcut; Remove __PCT_CTR_SHORTCUT__ entirely | Dwayne Litzenberger | 2013-07-14 | 1 | -0/+1 |
| | | | | | | | | | | | | 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 3 | Dwayne Litzenberger | 2013-07-14 | 1 | -5/+13 |
| | | | | | | | | | 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. | ||||
* | Add pycrypto_common.h and clean up a bunch of miscellaneous includes & typedefs | Dwayne Litzenberger | 2013-04-21 | 1 | -12/+2 |
| | |||||
* | Fix compiler warning about "_POSIX_C_SOURCE" being redefined in string.h | Dwayne Litzenberger | 2013-02-17 | 1 | -1/+1 |
| | | | | The solution is to include Python.h before string.h is included. | ||||
* | Fix block ciphers allowing empty string as IV | Dwayne C. Litzenberger | 2012-05-24 | 1 | -1/+1 |
| | | | | Bug report: https://bugs.launchpad.net/pycrypto/+bug/997464 | ||||
* | In ALGnew, check the mode before checking other parameters | Dwayne C. Litzenberger | 2012-05-24 | 1 | -15/+15 |
| | |||||
* | Removed PGP mode from block ciphers | Legrandin | 2012-05-14 | 1 | -137/+9 |
| | |||||
* | Merge branch 'master' into py3k | Dwayne C. Litzenberger | 2011-10-10 | 1 | -1/+0 |
|\ | | | | | | | | | | | Conflicts: setup.py src/_fastmath.c | ||||
| * | fix double-decref of "counter" when Cipher object initialisation fails | Ryan Kelly | 2011-03-07 | 1 | -1/+0 |
| | | |||||
* | | Changes to allow pycrpyto to work on Python 3.x as well as 2.1 through 2.7 | Thorsten Behrens | 2010-12-28 | 1 | -25/+153 |
|/ | |||||
* | Fix building PyCrypto on Win64 using MS Visual Studio 9.0. | Dwayne C. Litzenberger | 2009-12-13 | 1 | -1/+2 |
| | | | | | Thanks to Nevins Bartolomeo (https://launchpad.net/~nevins-bartolomeo) for contributing this fix. | ||||
* | block_template.c: Re-acquire the GIL during a nasty error casev2.1.0alpha2 | Lorenz Quack | 2009-10-16 | 1 | -0/+2 |
| | | | | | | This error should never occur, but we might as well handle it properly anyway. This fixes https://bugs.launchpad.net/pycrypto/+bug/452195 | ||||
* | Release the global interpreter lock during encryption, decryption, and hashing. | Dwayne C. Litzenberger | 2009-10-12 | 1 | -1/+13 |
| | | | | | | | These are the easy ones. We don't release the GIL on cipher initialization, hash initialization, or hash finalization, because those functions might make Python API calls, and we would need to add a mechism for re-acquiring the GIL in those cases. | ||||
* | Check for counter wraparound when encrypting using MODE_CTR | Dwayne C. Litzenberger | 2009-10-12 | 1 | -0/+4 |
| | | | | | - Add check_wraparound_func pointer to PCT_CounterObject - Call check_wraparound_func from block_template.c | ||||
* | block_template.c: Allow MODE_CTR to behave as a stream cipher | Dwayne C. Litzenberger | 2009-10-12 | 1 | -14/+55 |
| | |||||
* | block_template.c: Call ALG_Encrypt when using MODE_CTR, rather than ↵ | Dwayne C. Litzenberger | 2009-10-11 | 1 | -57/+5 |
| | | | | duplicating code in ALG_Decrypt | ||||
* | block_template.c: when using MODE_CFB, raise ValueError if segment_size is ↵ | Dwayne C. Litzenberger | 2009-10-10 | 1 | -3/+3 |
| | | | | not a multiple of 8 bits | ||||
* | block_template.c & stream_template.c: Add vim modelines | Dwayne C. Litzenberger | 2009-10-10 | 1 | -0/+1 |
| | |||||
* | Remove dead code related to IDEA and RC5 | Dwayne C. Litzenberger | 2009-10-10 | 1 | -37/+0 |
| | |||||
* | {block,stream,hash}_template.c: Replace the legal notices | Dwayne C. Litzenberger | 2009-08-03 | 1 | -5/+18 |
| | | | | I have permission to do this. See the LEGAL directory. | ||||
* | block_template.c: Fix what looks like some memory leaks that occur during errors | Dwayne C. Litzenberger | 2009-08-02 | 1 | -0/+4 |
| | |||||
* | block_template.c: Fix segfault when using MODE_CTR without specifying ↵ | Dwayne C. Litzenberger | 2009-08-02 | 1 | -1/+5 |
| | | | | | | counter= argument Thanks to launchpad.net user "ucg" for noticing this bug. | ||||
* | Util.Counter: Speed up CTR mode using shortcut | Dwayne C. Litzenberger | 2008-10-19 | 1 | -44/+97 |
| | | | | | This change allows CTR-mode ciphers to bypass the Python function call mechanism when using counter objects created using Crypto.Util.Counter. | ||||
* | RC5: Fix buffer overrun and test failures. | Dwayne C. Litzenberger | 2008-09-16 | 1 | -3/+3 |
| | | | | | | | | | Before this fix, the RC5 module would overrun its "L" buffer whenever the specified number of rounds exceeded 49 (the runtime check allowed up to 255 rounds). Also, any time the length of the key was less than a multiple of 4 bytes, the RC5 module would operate incorrectly. This commit fixes both bugs. | ||||
* | ARC2: Add 'effective_keylen' keyword parameter so we can pass the RFC 2268 tests | Dwayne C. Litzenberger | 2008-09-14 | 1 | -0/+23 |
| | |||||
* | [project @ robey@lag.net-20060815024756-0ee4d018bde70abe] | Robey Pointer | 2006-08-14 | 1 | -5/+5 |
| | | | | fix a few gcc warnings about signed/unsigned char and system-header-defined macros | ||||
* | [project @ akuchling-20020611190733-3139cc16cc4686a4] | akuchling | 2002-06-11 | 1 | -0/+1 |
| | | | | | [project @ 2002-06-11 12:07:33 by akuchling] Fix refcounting bug that caused core dumps (bug #567202, bug #567203 | ||||
* | [project @ akuchling-20020525015109-687c9cfd7ee58cf9] | akuchling | 2002-05-24 | 1 | -1/+9 |
| | | | | | | | | | [project @ 2002-05-24 18:51:09 by akuchling] Overwriting the object is safe in Python 2.2, but not in Python 2.1 because _PyObject_Del() looks at the type pointer to see if the type is GCed or not. Instead, just zap the block cipher states and all the other fields in ALGobject. In the allocator, set the counter field to NULL. | ||||
* | [project @ akuchling-20020524234241-bc4dc6959b6bf706] | akuchling | 2002-05-24 | 1 | -1/+1 |
| | | | | | [project @ 2002-05-24 16:42:41 by akuchling] Oops: PyObject_Del is actually the name to use | ||||
* | [project @ akuchling-20020524225121-d7c667dfcda3cee8] | akuchling | 2002-05-24 | 1 | -2/+2 |
| | | | | | [project @ 2002-05-24 15:51:21 by akuchling] Use canonical functions for allocating/deallocating objects |