diff options
author | daan <daanl@outlook.com> | 2020-09-06 08:33:27 -0700 |
---|---|---|
committer | daan <daanl@outlook.com> | 2020-09-06 08:33:27 -0700 |
commit | f7b94fe21c41d5890cda86f689973e554eb945df (patch) | |
tree | d8b8ae955f4eccfb961cef782232eee64d1cfaf7 /src/random.c | |
parent | e740242978b9f74a090570738035ea4d5a45602c (diff) |
experiment with bcrypt api again
Diffstat (limited to 'src/random.c')
-rw-r--r-- | src/random.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/random.c b/src/random.c index 2d15c18..a03e80c 100644 --- a/src/random.c +++ b/src/random.c @@ -162,14 +162,13 @@ If we cannot get good randomness, we fall back to weak randomness based on a tim -----------------------------------------------------------------------------*/ #if defined(_WIN32) -/* // We prefer BCryptGenRandom over RtlGenRandom but it leads to a crash a when using dynamic override combined with the C++ runtime :-( #pragma comment (lib,"bcrypt.lib") #include <bcrypt.h> static bool os_random_buf(void* buf, size_t buf_len) { return (BCryptGenRandom(NULL, (PUCHAR)buf, (ULONG)buf_len, BCRYPT_USE_SYSTEM_PREFERRED_RNG) >= 0); } -*/ +/* #pragma comment (lib,"advapi32.lib") #define RtlGenRandom SystemFunction036 #ifdef __cplusplus @@ -185,7 +184,7 @@ static bool os_random_buf(void* buf, size_t buf_len) { bool ok = (RtlGenRandom(buf, (ULONG)buf_len) != 0); return ok; } - +*/ #elif defined(ANDROID) || defined(XP_DARWIN) || defined(__APPLE__) || defined(__DragonFly__) || \ defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \ defined(__sun) || defined(__wasi__) |