Use rdrand as additional entropy source.

If available rdrand is used as an additional entropy source for the
PRNG and for additional input in FIPS mode.
This commit is contained in:
Dr. Stephen Henson
2013-12-25 15:00:39 +00:00
parent 4b64e0cbdb
commit ef643cc7bd
3 changed files with 81 additions and 0 deletions

View File

@@ -227,6 +227,7 @@ static size_t drbg_get_adin(DRBG_CTX *ctx, unsigned char **pout)
static unsigned char buf[16];
static unsigned long counter;
FIPS_get_timevec(buf, &counter);
rand_hw_xor(buf, sizeof(buf));
*pout = buf;
return sizeof(buf);
}