|
@@ -16,7 +16,7 @@
|
|
|
|
|
|
#if defined(LTC_DEVRANDOM) && !defined(_WIN32)
|
|
#if defined(LTC_DEVRANDOM) && !defined(_WIN32)
|
|
/* on *NIX read /dev/random */
|
|
/* on *NIX read /dev/random */
|
|
-static unsigned long rng_nix(unsigned char *buf, unsigned long len,
|
|
|
|
|
|
+static unsigned long _rng_nix(unsigned char *buf, unsigned long len,
|
|
void (*callback)(void))
|
|
void (*callback)(void))
|
|
{
|
|
{
|
|
#ifdef LTC_NO_FILE
|
|
#ifdef LTC_NO_FILE
|
|
@@ -56,7 +56,7 @@ static unsigned long rng_nix(unsigned char *buf, unsigned long len,
|
|
|
|
|
|
#define ANSI_RNG
|
|
#define ANSI_RNG
|
|
|
|
|
|
-static unsigned long rng_ansic(unsigned char *buf, unsigned long len,
|
|
|
|
|
|
+static unsigned long _rng_ansic(unsigned char *buf, unsigned long len,
|
|
void (*callback)(void))
|
|
void (*callback)(void))
|
|
{
|
|
{
|
|
clock_t t1;
|
|
clock_t t1;
|
|
@@ -97,7 +97,7 @@ static unsigned long rng_ansic(unsigned char *buf, unsigned long len,
|
|
#include <windows.h>
|
|
#include <windows.h>
|
|
#include <wincrypt.h>
|
|
#include <wincrypt.h>
|
|
|
|
|
|
-static unsigned long rng_win32(unsigned char *buf, unsigned long len,
|
|
|
|
|
|
+static unsigned long _rng_win32(unsigned char *buf, unsigned long len,
|
|
void (*callback)(void))
|
|
void (*callback)(void))
|
|
{
|
|
{
|
|
HCRYPTPROV hProv = 0;
|
|
HCRYPTPROV hProv = 0;
|
|
@@ -143,12 +143,12 @@ unsigned long rng_get_bytes(unsigned char *out, unsigned long outlen,
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#if defined(_WIN32) || defined(_WIN32_WCE)
|
|
#if defined(_WIN32) || defined(_WIN32_WCE)
|
|
- x = rng_win32(out, outlen, callback); if (x != 0) { return x; }
|
|
|
|
|
|
+ x = _rng_win32(out, outlen, callback); if (x != 0) { return x; }
|
|
#elif defined(LTC_DEVRANDOM)
|
|
#elif defined(LTC_DEVRANDOM)
|
|
- x = rng_nix(out, outlen, callback); if (x != 0) { return x; }
|
|
|
|
|
|
+ x = _rng_nix(out, outlen, callback); if (x != 0) { return x; }
|
|
#endif
|
|
#endif
|
|
#ifdef ANSI_RNG
|
|
#ifdef ANSI_RNG
|
|
- x = rng_ansic(out, outlen, callback); if (x != 0) { return x; }
|
|
|
|
|
|
+ x = _rng_ansic(out, outlen, callback); if (x != 0) { return x; }
|
|
#endif
|
|
#endif
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|