11 Feb
2010
11 Feb
'10
4:17 p.m.
AMDG Ovanes Markarian wrote:
The memcpy should copy from randomBytes into seed. (Assuming I haven't forgotten the signature of memcpy.)
Seems, like I forgot the signature... Another way to transfer the bytes would be:
union bytes2seed { uint64_t seed_; char bytes_[sizeof(uint64_t)]; };
bytes2seed converter;
Now one can pass &converter.bytes_[0] to CryptGenRandom. This does not require an additional memcpy call.
Casting through a union is undefined behavior. :(. In Christ, Steven Watanabe