Skip to content

Commit

Permalink
Entropy Apple: change time function called
Browse files Browse the repository at this point in the history
Use clock_gettime_nsec_np and get the raw monotonic counter.
  • Loading branch information
SparkiDev committed Jan 15, 2025
1 parent e76186f commit 6e38354
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wolfcrypt/src/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ static WC_INLINE word64 Entropy_TimeHiRes(void)
*/
static WC_INLINE word64 Entropy_TimeHiRes(void)
{
return mach_absolute_time();
return clock_gettime_nsec_np(CLOCK_MONOTONIC_RAW);
}
#elif !defined(ENTROPY_MEMUSE_THREAD) && defined(__aarch64__)
/* Get the high resolution time counter.
Expand Down

0 comments on commit 6e38354

Please sign in to comment.