Merge pull request #405 from azet/master

document why RtlGenRandom is used
This commit is contained in:
Frank Denis 2016-06-15 15:54:36 +02:00 committed by GitHub
commit c3999056b5

View File

@ -25,6 +25,12 @@
#include "utils.h"
#ifdef _WIN32
/* `RtlGenRandom` is used over `CryptGenRandom` on Microsoft Windows based systems:
* - `CryptGenRandom` requires pulling in `CryptoAPI` which causes unnecessary
* memory overhead if no other Cryptography functionally is required.
* - `RtlGenRandom` is thus called directly instead. A detailed explaination
* can be found here: https://blogs.msdn.microsoft.com/michael_howard/2005/01/14/cryptographically-secure-random-number-on-windows-without-using-cryptoapi/
*/
# include <windows.h>
# define RtlGenRandom SystemFunction036
# if defined(__cplusplus)