From: Oliver Kurth Date: Tue, 30 Apr 2019 20:24:25 +0000 (-0700) Subject: Changes to common source files not directly applicable to open-vm-tools. X-Git-Tag: stable-11.0.0~103 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=35570e72d3833b73db653c89c84223c959856467;p=thirdparty%2Fopen-vm-tools.git Changes to common source files not directly applicable to open-vm-tools. Added the function Random_FastStream64() to provide a 64-bit random number if needed. --- diff --git a/open-vm-tools/lib/include/random.h b/open-vm-tools/lib/include/random.h index 80c5c5f1c..5b02cd7c9 100644 --- a/open-vm-tools/lib/include/random.h +++ b/open-vm-tools/lib/include/random.h @@ -101,6 +101,7 @@ typedef struct { } RandomFastContext; uint32 Random_FastStream(RandomFastContext *rfc); +uint64 Random_FastStream64(RandomFastContext *rfc); void Random_FastStreamSeed(RandomFastContext *rfc, uint64 seed, uint64 seq); /* diff --git a/open-vm-tools/lib/misc/prng.c b/open-vm-tools/lib/misc/prng.c index d72ba8cef..9290f8a03 100644 --- a/open-vm-tools/lib/misc/prng.c +++ b/open-vm-tools/lib/misc/prng.c @@ -169,6 +169,13 @@ Random_FastStream(RandomFastContext *rfc) // IN/OUT: return RandomFastImpl(&rfc->state, rfc->sequence); } +uint64 +Random_FastStream64(RandomFastContext *rfc) // IN/OUT: +{ + return QWORD(RandomFastImpl(&rfc->state, rfc->sequence), + RandomFastImpl(&rfc->state, rfc->sequence)); +} + void Random_FastStreamSeed(RandomFastContext *rfc, // OUT: uint64 seed, // IN: