Commit graph

9 commits

Author SHA1 Message Date
Legrandin
d83380a048 Removed support for Python<2.4 2014-06-16 20:36:35 +02:00
Dwayne Litzenberger
5d1cd3da0e Fix random.shuffle SelfTest
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.
2013-02-16 11:02:10 -08:00
Thorsten Behrens
b27696462b Improve random selftest
o Random selftest is improved, less likely to collide
o random.shuffle() is more pythonic
2011-01-05 07:54:04 -05:00
Thorsten Behrens
ff0e5ad409 Additional random unit tests; fix a random unit test
Patch as per Lorenz on the mailing list.
2011-01-04 15:33:15 -05:00
Thorsten Behrens
5dc2f8f216 Add unit tests for Crypto.Random.random
o Add unit tests
o Fix random.shuffle()
o random.sample() does not work on 2.1. This has not been fixed.
2010-12-31 00:15:34 -05:00
Dwayne C. Litzenberger
d5d88413fc Random: Add Crypto.Random.get_random_bytes()
This should allow people to use something like this if they want
backwards-compatibility:

try:
     from Crypto.Random import get_random_bytes
except ImportError:
     try:
         from os import urandom as get_random_bytes
     except ImportError:
         get_random_bytes = open("/dev/urandom", "rb").read
2009-08-28 12:10:25 -04:00
Dwayne C. Litzenberger
5c3ec88e89 SelfTest: Fix comment 2009-04-25 14:05:13 -04:00
Dwayne C. Litzenberger
386de1947b Legal: Dedicate my files to the public domain.
In an attempt to simplify the copyright status of PyCrypto, I'm placing my
code into the public domain, and encouraging other contributors to do the
same.

I have used a public domain dedication that was recommended in a book on FOSS legal
issues[1], followed by the warranty disclaimer boilerplate from the MIT license.

[1] _Intellectual Property and Open Source: A Practical Guide to Protecting
    Code_, a book written by Van Lindberg and published by O'Reilly Media.
    (ISBN 978-0-596-51796-0)
2009-03-01 10:22:51 -05:00
Dwayne C. Litzenberger
ff8a657a8d cleanup: Move modules to "lib/Crypto" subdirectory.
This will avoid the previous situation where scripts like the old "test.py"
get included accidentally in a release.  It also frees us to put additional
build scripts in the top-level directory of the source tree.
2009-02-28 13:14:53 -05:00
Renamed from SelfTest/Random/test_random.py (Browse further)