dhcpcd/compat/arc4random.h
Tobias Heider 837d09e34c
compat: update arc4random() to newer chacha20 based version from OpenBSD (#227)
* compat: update arc4random() to newer chacha20 based version from OpenBSD

* arc4random: keep fd after first call to arc4random

privsep + chroot doesn't allow us to reopen /dev/urandom in
an unpriviledged process so we open the fd once and then
hold onto it.
2023-09-04 14:53:44 +01:00

19 lines
437 B
C

/*
* Arc4 random number generator for OpenBSD.
* Copyright 1996 David Mazieres <dm@lcs.mit.edu>.
*
* Modification and redistribution in source and binary forms is
* permitted provided that due credit is given to the author and the
* OpenBSD project by leaving this copyright notice intact.
*/
#ifndef ARC4RANDOM_H
#define ARC4RANDOM_H
#include <stdint.h>
uint32_t arc4random(void);
void arc4random_buf(void *, size_t);
#endif