]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Changes to common source files not directly applicable to open-vm-tools.
authorOliver Kurth <okurth@vmware.com>
Tue, 30 Apr 2019 20:24:25 +0000 (13:24 -0700)
committerOliver Kurth <okurth@vmware.com>
Tue, 30 Apr 2019 20:24:25 +0000 (13:24 -0700)
Added the function Random_FastStream64() to provide a 64-bit random number
if needed.

open-vm-tools/lib/include/random.h
open-vm-tools/lib/misc/prng.c

index 80c5c5f1c12cd6bef36687e1e61917207db0d69d..5b02cd7c9c2daa87e2acb2289be24335be167b47 100644 (file)
@@ -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);
 
 /*
index d72ba8cefec181ccc1f333ffa30ba45773c6234f..9290f8a034e642fb66d75d6fe079966c29dd4ad6 100644 (file)
@@ -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: