I believe Wireguard is implemented in the kernel. I'd argue there should be a kernel-wide wrapper function for this sort of thing, or if that already exists, Wireguard should probably use it.
That doesn't explain why systemd uses it, of course.
That doesn't explain why systemd uses it, of course.
[1]: https://elixir.bootlin.com/linux/v5.3.6/source/drivers/char/...
In comparison get_random_u32() is safe to call at any point — including early boot — and does not affect global entropy pool. At worst it may return low-quality numbers, but that can be easily fixed by running your own peudo-random generator on top of it (which is a good idea anyway because you don't want your kernel module to contend with other parties for RNG ownership).