From 6e383547ddb12dddcf5bd3932e6828e8125762b0 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Thu, 16 Jan 2025 04:14:55 +1000 Subject: [PATCH] Entropy Apple: change time function called Use clock_gettime_nsec_np and get the raw monotonic counter. --- wolfcrypt/src/random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wolfcrypt/src/random.c b/wolfcrypt/src/random.c index febc29243f..c2838dc582 100644 --- a/wolfcrypt/src/random.c +++ b/wolfcrypt/src/random.c @@ -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.