gcc/libstdc++-v3/src
Jonathan Wakely 58f339fc5e libstdc++: Implement std::random_device::entropy() for other sources
Currently this function only returns a non-zero value for /dev/random
and /dev/urandom. When a hardware instruction such as RDRAND is in use
it should (in theory) be perfectly random and produce 32 bits of entropy
in each 32-bit result. Add a helper function to identify the source of
randomness from the _M_func and _M_file data members, and return a
suitable value when RDRAND or RDSEED is being used.

libstdc++-v3/ChangeLog:

	* src/c++11/random.cc (which_source): New helper function.
	(random_device::_M_getentropy()): Use which_source and return
	suitable values for sources other than device files.
	* testsuite/26_numerics/random/random_device/entropy.cc: New test.
2021-10-19 17:27:06 +01:00
..
c++11 libstdc++: Implement std::random_device::entropy() for other sources 2021-10-19 17:27:06 +01:00
c++17 libstdc++: Fix typos in std::filesystem code 2021-10-02 21:20:05 +01:00
c++20 Update copyright years. 2021-01-04 10:26:59 +01:00
c++98 libstdc++: Allow stateful allocators in std::list::sort [PR 66742] 2021-10-01 20:36:56 +01:00
filesystem libstdc++: Fix typos in std::filesystem code 2021-10-02 21:20:05 +01:00
shared Update copyright years. 2021-01-04 10:26:59 +01:00
Makefile.am libstdc++: Regenerate the src/debug Makefiles as needed 2021-09-16 23:06:38 +01:00
Makefile.in libstdc++: Regenerate the src/debug Makefiles as needed 2021-09-16 23:06:38 +01:00