This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[PATCH]std::random_device for win32 (MinGW) ABI implementation
- From: sotrdg sotrdg <euloanty at live dot com>
- To: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- Date: Fri, 12 Oct 2018 17:45:55 +0000
- Subject: [PATCH]std::random_device for win32 (MinGW) ABI implementation
The implementation is on the GitHub.
https://github.com/euloanty/mingw-std-random_device/blob/master/random_device_gcc_withcxx11abi/random.cc
This implementation does several changes towards the original random.cc.
1. Type Erasure Abstractions for various random_devices so we can choose any of them to use if necessary.
2. Solve security issue of setvbuf(fp,nullptr,_IONBF,0); In order to avoid seeds leaking to other processes after releasing the buffer of std::FILE*.
3. For amd64 platform, random_device will prefer using rdseed instruction instead of rdrand instruction
4. For Windows, random_device will get seeds from RtlGenRandom and buffer it.
5. Legacy support for mt19937.
I’ve put it on the GitHub for anyone.
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10