Home GnuPG

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

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).

(cherry picked from commit 0cdd24456b33defc7f8176fa82ab694fbc284385)

  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Provenance
jukiviliAuthored on Apr 29 2015, 5:18 PM
wernerCommitted on Sep 8 2015, 8:16 AM
Parents
rC59058aaca089: random: Silent warning under NetBSD using rndunix
Branches
Unknown
Tags
Unknown

Event Timeline

Werner Koch <wk@gnupg.org> committed rC84be4b23fca5: Prepare random/win32.c fast poll for 64-bit Windows (authored by Jussi Kivilinna <jussi.kivilinna@iki.fi>).Sep 8 2015, 8:16 AM