void arc4random_addrandom(unsigned char *dat, int datlen) { arc4_check_init(); arc4_check_stir(); arc4_addrandom(&rs, dat, datlen); }
void arc4random_addrandom(u_char *dat, int datlen) { THREAD_LOCK(); arc4_check_init(); arc4_check_stir(); arc4_addrandom(dat, datlen); THREAD_UNLOCK(); }
void arc4random_stir(void) { THREAD_LOCK(); arc4_check_init(); arc4_stir(); rs_stired = 1; THREAD_UNLOCK(); }
unsigned int arc4random(void) { unsigned int rnd; arc4_check_init(); arc4_check_stir(); rnd = arc4_getword(&rs); return (rnd); }
void arc4random_buf(void *_buf, size_t n) { u_char *buf = (u_char *)_buf; THREAD_LOCK(); arc4_check_init(); while (n--) { arc4_check_stir(); buf[n] = arc4_getbyte(); arc4_count--; } THREAD_UNLOCK(); }
u_int32_t arc4random(void) { u_int32_t rnd; THREAD_LOCK(); arc4_check_init(); arc4_check_stir(); rnd = arc4_getword(); arc4_count -= 4; THREAD_UNLOCK(); return (rnd); }
void arc4random_stir(void) { arc4_check_init(); arc4_stir(&rs); }