You can also specify the number of bytes you want with RtlGenRandom.  rand_s only gives an unsigned int per call.  Not a huge deal but you may be able to cut down on some function call overhead depending on how stuff gets inlined&#x2F;optimized.