This is a partial backport of [[https://github.com/bitcoin/bitcoin/pull/28100 | core#28100]]
https://github.com/bitcoin/bitcoin/pull/28100/commits/44c11769a83b90ca6b8af086d6fa69ff7ac1c3ae
with fillrand() from [[https://github.com/bitcoin/bitcoin/pull/27479 | core#27479]] & modifications that should normally be applied in D19034
Depends on D19034