Some notes about RtlGenRandom

This commit is contained in:
Frank Denis 2017-08-16 20:58:22 +02:00
parent 914ff87576
commit 80296be947

View File

@ -36,6 +36,15 @@
* memory overhead if this API is not being used for other purposes
* - `RtlGenRandom` is thus called directly instead. A detailed explanation
* can be found here: https://blogs.msdn.microsoft.com/michael_howard/2005/01/14/cryptographically-secure-random-number-on-windows-without-using-cryptoapi/
*
* In spite of the disclaimer on the `RtlGenRandom` documentation page that was
* written back in the Windows XP days, this function is here to stay. The CRT
* function `rand_s()` directly depends on it, so touching it would break many
* applications released since Windows XP.
*
* Also note that Rust and BoringSSL (thus, Google Chrome and everything based
* on Chromium) also depend on it, and that libsodium allows the RNG to be
* replaced without patching nor recompiling the library.
*/
# include <windows.h>
# define RtlGenRandom SystemFunction036