Add arc4random_stir and arc4random_addrandom for OpenBSD compatibility
* libc/stdlib/arc4random.c (arc4random_stir): New function. (arc4random_addrandom): Ditto. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
parent
f74cf1350e
commit
5ccdcf0219
@ -193,3 +193,21 @@ arc4random_buf(void *buf, size_t n)
|
||||
_rs_random_buf(buf, n);
|
||||
_ARC4_UNLOCK();
|
||||
}
|
||||
|
||||
void
|
||||
arc4random_stir(void)
|
||||
{
|
||||
_ARC4_LOCK();
|
||||
_rs_stir();
|
||||
_ARC4_UNLOCK();
|
||||
}
|
||||
|
||||
void
|
||||
arc4random_addrandom(u_char *dat, int datlen)
|
||||
{
|
||||
_ARC4_LOCK();
|
||||
if (!rs)
|
||||
_rs_stir();
|
||||
_rs_rekey(dat, datlen);
|
||||
_ARC4_UNLOCK();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user