| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | |
|
| | | |
| | | |
| | | |
| | | | |
to gmp
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
(as submitted here https://bugs.launchpad.net/pycrypto/+bug/544792)
so that they are available also in Python 2.1, 2.2, 2.3 and 2.4.
Regardless where the implementation comes from (Python standard
library or our native modules, depending on the Python version),
all Crypto.Hash objects are always used as front-ends.
|
| | | | |
|
|\ \ \ \
| | |_|/
| |/| | |
|
| |\ \ \
| | | | |
| | | | | |
fix double-decref of counter when Cipher initialisation fails
|
| | | |/
| | |/| |
|
| |/ /
| | |
| | |
| | | |
block of 128 bytes long
|
| |/
| |
| |
| |
| |
| | |
timing attacks.
Thanks to Geremy Condra for pointing this out.
|
| |
| |
| |
| | |
work with PKCS#1 PSS. Add also test cases for it for every hash.
|
| | |
|
| | |
|
| |
| |
| |
| | |
it (that is, because it helps a little the inversion step that follows).
|
| |
| |
| |
| |
| |
| |
| |
| | |
Small fix to importKey documentation (ASN.1 structure names were
incorrect for public keys).
Factors of an RSA private key are computed from private exponent d
(both slowmath and fastmath).
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Legrandin's getStrongPrime() patch changed the behaviour of
Crypto.Util.number.getRandomNumber() to something that is more like what
people would expect, but different from what we did before. This change
modifies Crypto.Util.number in the following ways:
- Rename getRandomNBitNumber -> getRandomNBitInteger
and getRandomNumber -> getRandomInteger
- Preserve old behaviour by making getRandomNumber work the same as
getRandomNBitInteger.
- Emit a DeprecationWarning when the old getRandomNumber is used.
|
|
|
|
| |
This could occur if getRNG() returns NULL.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From http://lists.dlitz.net/pipermail/pycrypto/2009q4/000167.html, with the
following explanation included in the email:
=== snip ===
Hi there!
Here comes my monster patch.
It includes a python and C version of getStrongPrime, rabinMillerTest and isPrime.
there are also two small unit tests and some helper functions.
They all take a randfunc and propagate them (or so I hope).
The Rabin-Miller-Test uses random bases (non-deterministic).
getStrongPrime and isPrime take an optional parameter "false_positive_prob"
where one can specify the maximum probability that the prime is actually
composite. Internally the functions calculate the Rabin-Miller rounds from
this. It defaults to 1e-6 (1:1000000) which results in 10 rounds of Rabin-Miller
testing.
Please review this carefully. Even though I tried hard to get things right some
bugs always slip through.
maybe you could also review the way I acquire and release the GIL. It felt kind
of ugly the way I did it but I don't see a better way just now.
Concerning the public exponent e:
I now know why it needs to be coprime to p-1 and q-1. The private exponent d is
the inverse of e mod ((p-1)(q-1)).
If e is not coprime to ((p-1)(q-1)) then the inverse does not exist [1].
The getStrongPrime take an optional argument e. if provided the function will
make sure p-1 and e are coprime. if e is even (p-1)/2 will be coprime.
if e is even then there is a additional constraint: p =/= q mod 8.
I can't check for that in getStrongPrime of course but since we hardcoded e to
be odd in _RSA.py this should pose no problem.
The Baillie-PSW-Test is not included.
I tried hard not to use any functionality new than 2.1 but if you find anything
feel free to criticize. Also if I didn't get the coding style right either tell
me or feel free to correct it yourself.
have fun.
//Lorenz
[1] http://mathworld.wolfram.com/ModularInverse.html
=== snip ===
|
|
|
|
|
| |
Thanks to Nevins Bartolomeo (https://launchpad.net/~nevins-bartolomeo) for
contributing this fix.
|
|
|
|
|
|
| |
This error should never occur, but we might as well handle it properly anyway.
This fixes https://bugs.launchpad.net/pycrypto/+bug/452195
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
- Add check_wraparound_func pointer to PCT_CounterObject
- Call check_wraparound_func from block_template.c
|
|
|
|
|
| |
The old behaviour can be obtained by explicitly setting allow_wraparound=True
when invoking Counter.new
|
| |
|
| |
|
| |
|
|
|
|
| |
duplicating code in ALG_Decrypt
|
| |
|
|
|
|
| |
not a multiple of 8 bits
|
| |
|
| |
|
|
|
|
| |
This fixes https://bugs.launchpad.net/pycrypto/+bug/439958
|
|
|
|
| |
I have permission to do this. See the LEGAL directory.
|
|
|
|
| |
I have permission to do this. See the LEGAL directory.
|
|
|
|
| |
I have permission to do this. See the LEGAL directory.
|
|
|
|
| |
I have permission to do this. See the LEGAL directory.
|
|
|
|
| |
I have permission to do this. See the LEGAL directory.
|
|
|
|
| |
I have permission to do this. See the LEGAL directory.
|
|
|
|
|
| |
I have permission to do this (provided that the original "rc2.c" code really
is in the public domain, which I think it is). See the LEGAL directory.
|
|
|
|
| |
This is mainly for completeness. The file is almost empty.
|
|
|
|
| |
I have permission to do this. See the LEGAL directory.
|
|
|
|
| |
I have permission to do this. See the LEGAL directory.
|
|
|
|
|
|
|
|
| |
PyCrypto 2.0.1 supported two-key 3DES, but the default LibTomCrypt
imlementation does not.
This commit adds two-key 3DES support to the bundled LibTomCrypt
implementation.
|
| |
|
|
|
|
|
|
| |
counter= argument
Thanks to launchpad.net user "ucg" for noticing this bug.
|
| |
|
|
|
|
|
|
|
|
| |
This partly reverts commit 5b5b496c0f81f3595d0aebb8da5196492abae429.
--author='akuchling <akuchling@rivest.dlitz.net>' used so that "git blame"
will show the true author of the source code. The author of this *commit* is
Dwayne C. Litzenberger.
|
|
|
|
|
|
| |
various custom "error" exceptions
At some point, it might be a good idea to remove the custom error classes themselves.
|