On Sun, Mar 03, 2024 at 12:58:20AM +0100, Elie Le Vaillant wrote:
> I'm using the web interface to the mailing list to check what has been
> sent, and these patches were not sent.
The web archive is not reliable and often drops mails.
> + * Copied off OpenBSD (original is arc4random_uniform)
> + */
> +uint32_t
> +random_uniform(uint32_t upper_bound)
> + r = random(); /* arc4random() is better, but we don't always have it */
I'm not sure why you think arc4random() is better. I doubt you need any
cryptograhic guarantees here. Personally I'd just go with a simple PCG
construction. It takes about ~6 lines of code [0], is fast and has good
statistical properties. Would also avoid spending time locking/unlocking
mutex inside libc for no reason.