Re: randomness (crypto?) code example wanted please?

Roy Marples <[email protected]> Sun, 25 Jun 2017 15:22:07 +0100
Newsgroups gmane.os.netbsd.devel.crypto,gmane.os.netbsd.devel.userlevel
Message-ID <[email protected]>
On 25/06/2017 14:28, Kamil Rytarowski wrote:
> On 25.06.2017 14:06, Martin Husemann wrote:
>> You can also read random bytes from /dev/urandom.
>>
>> Martin
> 
> Right this is the most portable solution right now. I don't think
> RANDOM_BITS or similar is currently useful, it will grow incompatible
> extension - better to prompt POSIX to standardize something.

Don't count on that happening soon.
http://austingroupbugs.net/view.php?id=859

dhcpcd ships with the the original OpenBSD version of arc4random that 
seeds off urandom if it cannot detect it in libc in configure. It also 
has arc4random_uniform as well.

All modern BSD's have arc4random (and most have arc4random_uniform) - 
some use something more modern like ChaCha, so it's just an interface 
really.

Just like sh, dhcpcd can start very early .... sometimwes before enough 
entropy has been generated just to pull blindly from /dev/urandom 
because it can block - or did in the past; it might be fixed now.

Roy