void arc4random_buf(void *_buf, size_t n) { u_char *buf = (u_char *) _buf; if (!rs_initialized) arc4_stir(); while (n--) { if (--arc4_count <= 0) arc4_stir(); buf[n] = arc4_getbyte(); } }
void arc4random_buf(void *_buf, size_t n) { u_char *buf = (u_char *)_buf; _ARC4_LOCK(); if (!rs_initialized || arc4_stir_pid != getpid()) arc4_stir(); while (n--) { if (--arc4_count <= 0) arc4_stir(); buf[n] = arc4_getbyte(); } _ARC4_UNLOCK(); }
static void arc4_stir_if_needed( void ) { #if defined( NO_PID_CHECK ) if( arc4_count <= 0 || ! rs_initialized ) arc4_stir(); #else pid_t pid = getpid(); if( arc4_count <= 0 || ! rs_initialized || arc4_stir_pid != pid ) { arc4_stir_pid = pid; arc4_stir(); } #endif }
void arc4random_stir(void) { _ARC4_LOCK(); arc4_stir(); _ARC4_UNLOCK(); }
static inline void arc4_check_stir(void) { if (!rs_stired || arc4_count <= 0) { arc4_stir(); rs_stired = 1; } }
static void arc4_check_stir(void) { if (!rs_stired || --arc4_count == 0) { arc4_stir(&rs); rs_stired = 1; } }
u_int32_t arc4random(void) { u_int32_t val; arc4_count -= 4; if (arc4_count <= 0 || !rs_initialized) arc4_stir(); val = arc4_getword(); return val; }
static void __arc4random_stir(void) { if (!rs_initialized) { arc4_init(&rs); rs_initialized = 1; } arc4_stir(&rs); }
u_int8_t __arc4_getbyte(void) { u_int8_t val; if (--arc4_count == 0 || !rs_initialized) arc4_stir(); val = arc4_getbyte(); return val; }
void arc4random_stir(void) { THREAD_LOCK(); arc4_check_init(); arc4_stir(); rs_stired = 1; THREAD_UNLOCK(); }
ARC4RANDOM_EXPORT int arc4random_stir(void) { int val; _ARC4_LOCK(); val = arc4_stir(); _ARC4_UNLOCK(); return val; }
void arc4random_addrandom(u_char *dat, int datlen) { _ARC4_LOCK(); if (!rs_initialized) arc4_stir(); arc4_addrandom(dat, datlen); _ARC4_UNLOCK(); }
static void arc4_stir_if_needed(void) { pid_t pid = getpid(); if (arc4_count <= 0 || !rs_initialized || arc4_stir_pid != pid) { arc4_stir_pid = pid; arc4_stir(); } }
void arc4random_stir(void) { if (!rs_initialized) { arc4_init(); rs_initialized = 1; atexit(arc4_atexit); } arc4_stir(); }
void arc4random_stir() { if (!rs_initialized) { arc4_init(&rs); rs_initialized = 1; } arc4_stir(&rs); }
int evutil_secure_rng_init(void) { int val; _ARC4_LOCK(); if (!arc4_seeded_ok) arc4_stir(); val = arc4_seeded_ok ? 0 : -1; _ARC4_UNLOCK(); return val; }
u_int32_t arc4random(void) { u_int32_t val; _ARC4_LOCK(); arc4_count -= 4; if (arc4_count <= 0 || !rs_initialized || arc4_stir_pid != getpid()) arc4_stir(); val = arc4_getword(); _ARC4_UNLOCK(); return val; }
ARC4RANDOM_EXPORT void arc4random_buf(void *_buf, size_t n) { unsigned char *buf = _buf; _ARC4_LOCK(); arc4_stir_if_needed(); while (n--) { if (--arc4_count <= 0) arc4_stir(); buf[n] = arc4_getbyte(); } _ARC4_UNLOCK(); }
void arc4random_buf(void *_buf, size_t n) { u_char *buf = (u_char *)_buf; _ARC4_LOCK(); arc4_stir_if_needed(); while (n--) { if (--arc4_count <= 0) arc4_stir(); buf[n] = arc4_getbyte(); } _ARC4_UNLOCK(); }
int evutil_secure_rng_init(void) { int val; if (!arc4rand_lock) { EVTHREAD_ALLOC_LOCK(arc4rand_lock, 0); } _ARC4_LOCK(); if (!arc4_seeded_ok) arc4_stir(); val = arc4_seeded_ok ? 0 : -1; _ARC4_UNLOCK(); return val; }
ARC4RANDOM_EXPORT void arc4random_addrandom(const unsigned char *dat, int datlen) { int j; _ARC4_LOCK(); if (!rs_initialized) arc4_stir(); for (j = 0; j < datlen; j += 256) { /* arc4_addrandom() ignores all but the first 256 bytes of * its input. We want to make sure to look at ALL the * data in 'dat', just in case the user is doing something * crazy like passing us all the files in /var/log. */ arc4_addrandom(dat + j, datlen - j); } _ARC4_UNLOCK(); }
void arc4random_buf(void *_buf, size_t n) { uint8_t *buf = (uint8_t *)_buf; if (!rs_initialized || arc4_stir_pid != getpid()) arc4random_stir(); buf[0] = arc4_getbyte() % 3; while (buf[0]--) (void)arc4_getbyte(); while (n--) { if (--arc4_count <= 0) arc4_stir(); buf[n] = arc4_getbyte(); } }
void hb_arc4random_buf( void * _buf, HB_SIZE n ) { HB_U8 * buf = ( HB_U8 * ) _buf; ARC4_LOCK(); arc4_stir_if_needed(); while( n-- ) { if( --arc4_count <= 0 ) arc4_stir(); buf[ n ] = arc4_getbyte(); } ARC4_UNLOCK(); }
void arc4random_stir(void) { arc4_check_init(); arc4_stir(&rs); }
void arc4random_stir(void) { arc4_stir(); }
void arc4random_addrandom(u_char * dat, int datlen) { if (!rs_initialized) arc4_stir(); arc4_addrandom(dat, datlen); }