From 478066c6076934ef50f9cf922cfe55dd96580d12 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Wed, 23 Oct 2019 22:30:44 +0200 Subject: Linux/MacOSX: Add missing JitterEntropy implementation --- src/Crypto/jitterentropy-base-user.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/Crypto/jitterentropy-base-user.h') diff --git a/src/Crypto/jitterentropy-base-user.h b/src/Crypto/jitterentropy-base-user.h index cbb2f47e..04c19361 100644 --- a/src/Crypto/jitterentropy-base-user.h +++ b/src/Crypto/jitterentropy-base-user.h @@ -88,7 +88,7 @@ static VC_INLINE void jent_get_nstime(__u64 *out) #define EAX_EDX_RET(val, low, high) "=A" (val) #endif -static VC_INLINE void jent_get_nstime(__u64 *out) +VC_INLINE void jent_get_nstime(__u64 *out) { DECLARE_ARGS(val, low, high); asm volatile("rdtsc" : EAX_EDX_RET(val, low, high)); @@ -97,7 +97,10 @@ static VC_INLINE void jent_get_nstime(__u64 *out) #endif -static VC_INLINE void *jent_zalloc(size_t len) +#ifdef _MSC_VER +static +#endif +VC_INLINE void *jent_zalloc(size_t len) { void *tmp = NULL; tmp = TCalloc(len); @@ -111,7 +114,10 @@ static VC_INLINE void *jent_zalloc(size_t len) return tmp; } -static VC_INLINE void jent_zfree(void *ptr, unsigned int len) +#ifdef _MSC_VER +static +#endif +VC_INLINE void jent_zfree(void *ptr, unsigned int len) { if (len % 8) burn(ptr, len); @@ -123,7 +129,10 @@ static VC_INLINE void jent_zfree(void *ptr, unsigned int len) TCfree(ptr); } -static VC_INLINE int jent_fips_enabled(void) +#ifdef _MSC_VER +static +#endif +VC_INLINE int jent_fips_enabled(void) { return 0; } -- cgit v1.2.3