forked from wolfSSL/wolfssl
Merge pull request #6612 from dgarske/entropy_memuse_win32
Add support for MemUse Entropy on Windows.
This commit is contained in:
@@ -983,6 +983,20 @@ static void Entropy_StopThread(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* end if defined(HAVE_PTHREAD) */
|
/* end if defined(HAVE_PTHREAD) */
|
||||||
|
|
||||||
|
#elif defined(_WIN32) /* USE_WINDOWS_API */
|
||||||
|
|
||||||
|
/* Get the high resolution time counter.
|
||||||
|
*
|
||||||
|
* @return 64-bit timer
|
||||||
|
*/
|
||||||
|
static WC_INLINE word64 Entropy_TimeHiRes(void)
|
||||||
|
{
|
||||||
|
LARGE_INTEGER count;
|
||||||
|
QueryPerformanceCounter(&count);
|
||||||
|
return (word64)(count.QuadPart);
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#error "No high precision time available for MemUse Entropy."
|
#error "No high precision time available for MemUse Entropy."
|
||||||
@@ -1283,7 +1297,7 @@ static int Entropy_HealthTest_Proportion(byte noise)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
/* Get first value in queue - value to test. */
|
/* Get first value in queue - value to test. */
|
||||||
byte val = prop_samples[prop_first];
|
byte val = (byte)prop_samples[prop_first];
|
||||||
/* Store new sample in queue. */
|
/* Store new sample in queue. */
|
||||||
prop_samples[prop_last] = noise;
|
prop_samples[prop_last] = noise;
|
||||||
/* Update first index now that we have removed in from the queue. */
|
/* Update first index now that we have removed in from the queue. */
|
||||||
|
Reference in New Issue
Block a user