Home GnuPG

Prepare random/win32.c fast poll for 64-bit Windows
0cdd24456b33Unpublished

Unpublished Commit ยท Learn More

Not On Permanent Ref: This commit is not an ancestor of any permanent ref.

Description

Prepare random/win32.c fast poll for 64-bit Windows

* random/win32.c (_gcry_rndw32_gather_random_fast) [ADD]: Rename to
ADDINT.
(_gcry_rndw32_gather_random_fast): Add ADDPTR.
(_gcry_rndw32_gather_random_fast): Disable entropy gathering from
GetQueueStatus(QS_ALLEVENTS).
(_gcry_rndw32_gather_random_fast): Change minimumWorkingSetSize and
maximumWorkingSetSize to SIZE_T from DWORD.
(_gcry_rndw32_gather_random_fast): Only add lower 32-bits of
minimumWorkingSetSize and maximumWorkingSetSize to random poll.
(_gcry_rndw32_gather_random_fast) [__WIN64__]: Read TSC directly
using intrinsic.

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@iki.fi>

Details

Provenance
jukiviliAuthored on Apr 29 2015, 5:18 PM
Parents
rCf70195455534: Disable GCM and AES-NI assembly implementations for WIN64
Branches
Unknown
Tags
Unknown

Event Timeline

Jussi Kivilinna <jussi.kivilinna@iki.fi> committed rC0cdd24456b33: Prepare random/win32.c fast poll for 64-bit Windows (authored by Jussi Kivilinna <jussi.kivilinna@iki.fi>).May 1 2015, 6:12 PM