This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]