void PRNGInit(PRNGContext* ctx) { unsigned int seed; __asm rdtsc __asm mov seed,eax HashSHA256((u8*)&seed, 4, ctx->prng_key); memset(ctx->prng_key + 32,0,224); KeyExpansion(ctx->prng_key); }
QByteArray HashSHA256(QByteArray data) { uint8 hash[SHA256_DIGEST_SIZE]; HashSHA256((uint8*)data.data(), data.size(), hash); return QByteArray((const char*)hash, sizeof(hash)); }