[cfe-dev] [libcxx] random_device for Windows needs more storage

Aaron Ballman aaron at aaronballman.com
Mon Oct 7 14:37:01 PDT 2013


On Mon, Oct 7, 2013 at 5:31 PM, Yaron Keren <yaron.keren at gmail.com> wrote:
> Nick, I have seen RtlGenRandom, but I didn't initally use it since Microsoft
> is recommending to use CryptGenRandom instead:
>
> http://msdn.microsoft.com/en-us/library/windows/desktop/aa387694(v=vs.85).aspx
>
> [The RtlGenRandom function is available for use in the operating systems
> specified in the Requirements section. It may be altered or unavailable in
> subsequent versions. Instead, use the CryptGenRandom function.]
>
> Due to backward compatibility it's very low chance RtlGenRandom will
> actually go away, I'll use it.

I don't believe we should be using this function.  Technically, the
documentation states this is available for use with the operating
systems listed in the Requirements section, which only lists XP and
Server 2003.  Relying on this outside of those platforms is not only
bad form, but to boot, in order to use them, you need to dynamically
load SystemFunction036 from AdvApi32.dll.

~Aaron



More information about the cfe-dev mailing list