[Bug target/94087] std::random_device often fails when used from multiple threads

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu May 14 11:35:03 GMT 2020


--- Comment #14 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #13)
> I'd rather not have to do everything shown at
> https://software.intel.com/content/www/us/en/develop/articles/intel-digital-
> random-number-generator-drng-software-implementation-guide.html to produce a

That was meant to link to section 5.2.6 "Generating Seeds from RDRAND"

> stronger seed from RDRAND.

Given that RDRAND is already an acceptable implementation for
std::random_device, and the standard makes no guarantees about the
cryptographic strength of values returned from std::random_device, using RDRAND
directly is a reasonable alternative.

More information about the Gcc-bugs mailing list