Beispiel #1
0
void
arc4random_addrandom(unsigned char *dat, int datlen)
{
	arc4_check_init();
	arc4_check_stir();
	arc4_addrandom(&rs, dat, datlen);
}
Beispiel #2
0
void
arc4random_addrandom(u_char *dat, int datlen)
{
	THREAD_LOCK();
	arc4_check_init();
	arc4_check_stir();
	arc4_addrandom(dat, datlen);
	THREAD_UNLOCK();
}
Beispiel #3
0
void
arc4random_stir(void)
{
	THREAD_LOCK();
	arc4_check_init();
	arc4_stir();
	rs_stired = 1;
	THREAD_UNLOCK();
}
Beispiel #4
0
unsigned int
arc4random(void)
{
	unsigned int rnd;

	arc4_check_init();
	arc4_check_stir();
	rnd = arc4_getword(&rs);

	return (rnd);
}
Beispiel #5
0
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();
}
Beispiel #6
0
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);
}
Beispiel #7
0
void
arc4random_stir(void)
{
	arc4_check_init();
	arc4_stir(&rs);
}