[RFC PATCH] Prepare random/win32.c fast poll for 64-bit Windows

Jussi Kivilinna jussi.kivilinna at iki.fi
Tue Apr 28 17:57:59 CEST 2015

On 27.04.2015 14:59, Werner Koch wrote:
> On Sun, 26 Apr 2015 14:37, jussi.kivilinna at iki.fi said:
>>> Introduce entropy gatherer changes related to 64-bit Windows platform as done
>>> in cryptlib fast poll:
>>>  - Change ADD macro to ADDPTR/ADDINT to handle pointer values. ADDPTR
>>>    discards high 32-bits of 64-bit pointer values.
>>>  - minimum/maximumWorkingSetSize changed to SIZE_T type to avoid stack
>>>    corruption on 64-bit; only low 32-bits are used for entropy.
>>>  - Use __rdtsc() intrinsic on 64-bit (as TSC is always available).
>>> Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
>>> --
>>> Would this be enough for 64-bit Windows support?
>>> Slow poll differences cryptlib vs libgcrypt appear to be limited to sensor
>>> data reading from third party programs and reading of PnP data.
>> Any comments on this?
> I can't say for sure whether this is sufficient.  But if this patch
> tracks the changes from cryptlib it should be okay.  Cryptlib might have
> introduced other changes since the last time I checked.
> I assume you only looked for the 64 bit changes, right?

Yes, I tracked the changes related to 64-bit Windows.

There is issues with 64-bit Windows build that needs fixing also. Differences
between System V ABI and Win64 ABI cause problems with AMD64 assembly parts and
at some places pointers are cast to 'long' and on Win64 sizeof pointer !=
sizeof long.


> Shalom-Salam,
>    Werner

More information about the Gcrypt-devel mailing list