File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -983,6 +983,29 @@ static void Entropy_StopThread(void)
983983 }
984984}
985985 /* end if defined(HAVE_PTHREAD) */
986+
987+ #elif defined(_WIN32 ) /* USE_WINDOWS_API */
988+
989+ /* Get the high resolution time counter.
990+ *
991+ * @return 64-bit time that is the nanoseconds of current time.
992+ */
993+ static WC_INLINE word64 Entropy_TimeHiRes (void )
994+ {
995+ static int init = 0 ;
996+ static LARGE_INTEGER freq ;
997+ LARGE_INTEGER count ;
998+
999+ if (!init ) {
1000+ QueryPerformanceFrequency (& freq );
1001+ init = 1 ;
1002+ }
1003+
1004+ QueryPerformanceCounter (& count );
1005+
1006+ return (word64 )(count .QuadPart / (freq .QuadPart / 1000 / 1000 ));
1007+ }
1008+
9861009#else
9871010
9881011#error "No high precision time available for MemUse Entropy."
@@ -1283,7 +1306,7 @@ static int Entropy_HealthTest_Proportion(byte noise)
12831306 }
12841307 else {
12851308 /* Get first value in queue - value to test. */
1286- byte val = prop_samples [prop_first ];
1309+ byte val = ( byte ) prop_samples [prop_first ];
12871310 /* Store new sample in queue. */
12881311 prop_samples [prop_last ] = noise ;
12891312 /* Update first index now that we have removed in from the queue. */
You can’t perform that action at this time.
0 commit comments