changeset: 86107:176bb5a98463 branch: 3.3 parent: 86103:8ce8eae6abfa user: Georg Brandl date: Sun Oct 06 18:43:19 2013 +0200 files: Doc/library/os.rst Python/random.c description: Closes #15213: update comment for _PyOS_URandom diff -r 8ce8eae6abfa -r 176bb5a98463 Doc/library/os.rst --- a/Doc/library/os.rst Sun Oct 06 18:36:34 2013 +0200 +++ b/Doc/library/os.rst Sun Oct 06 18:43:19 2013 +0200 @@ -3306,8 +3306,9 @@ This function returns random bytes from an OS-specific randomness source. The returned data should be unpredictable enough for cryptographic applications, though its exact quality depends on the OS implementation. On a Unix-like - system this will query /dev/urandom, and on Windows it will use CryptGenRandom. - If a randomness source is not found, :exc:`NotImplementedError` will be raised. + system this will query ``/dev/urandom``, and on Windows it will use + ``CryptGenRandom()``. If a randomness source is not found, + :exc:`NotImplementedError` will be raised. For an easy-to-use interface to the random number generator provided by your platform, please see :class:`random.SystemRandom`. diff -r 8ce8eae6abfa -r 176bb5a98463 Python/random.c --- a/Python/random.c Sun Oct 06 18:36:34 2013 +0200 +++ b/Python/random.c Sun Oct 06 18:43:19 2013 +0200 @@ -224,8 +224,9 @@ } } -/* Fill buffer with size pseudo-random bytes, not suitable for cryptographic - use, from the operating random number generator (RNG). +/* Fill buffer with size pseudo-random bytes from the operating system random + number generator (RNG). It is suitable for for most cryptographic purposes + except long living private keys for asymmetric encryption. Return 0 on success, raise an exception and return -1 on error. */ int

AltStyle によって変換されたページ (->オリジナル) /