1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

Linux/MacOSX: Add missing JitterEntropy implementation

This commit is contained in:
Mounir IDRASSI
2019-10-23 22:30:44 +02:00
parent 74e14c070f
commit 478066c607
4 changed files with 39 additions and 4 deletions

View File

@@ -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;
}