Commit graph

6 commits

Author SHA1 Message Date
Legrandin
afd6328f9c Simplify the random number generator
Replace the user-space RNG with a thin wrapper to os.urandom.
Remove all OS-specific RNG modules.
2014-06-16 20:36:35 +02:00
Dwayne C. Litzenberger
094d70b64d Python 3.x fixes:
- Use absolute imports
- Fix StringIO import so that 2to3 can translate it
2011-10-22 15:07:47 -04: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
a94b21dcb3 Random: Remove RandomPoolCompat
RandomPoolCompat seems to give people the wrong idea that it's okay to use
RandomPool if Crypto.Random is not available.

    try:
      from Crypto.Random import RandomPoolCompat as RandomPool
    except ImportError:
      from Crypto.Util.randpool import RandomPool

In order to discourage all use of RandomPool, I'm getting rid of
RandomPoolCompat.  Instead, Crypto.Util.randpool.RandomPool will be a wrapper
around Crypto.Random that emits a DeprecationWarning.
2009-08-28 12:10:24 -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 Random/__init__.py (Browse further)