summaryrefslogtreecommitdiffstats
path: root/openssl/MacOS/Randomizer.h
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-05-02 16:06:33 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-05-02 16:06:33 (GMT)
commit335ca9eb0d2337314cbbec5eb19f9aeea0eaaca7 (patch)
tree0a0e8d65ee114cb89f58c3159488dd5523123309 /openssl/MacOS/Randomizer.h
parenta90d8737b83a4a5bb2bf91a9bdf48a3dad4b51fa (diff)
downloadblt-335ca9eb0d2337314cbbec5eb19f9aeea0eaaca7.zip
blt-335ca9eb0d2337314cbbec5eb19f9aeea0eaaca7.tar.gz
blt-335ca9eb0d2337314cbbec5eb19f9aeea0eaaca7.tar.bz2
initial commit
Diffstat (limited to 'openssl/MacOS/Randomizer.h')
-rw-r--r--openssl/MacOS/Randomizer.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/openssl/MacOS/Randomizer.h b/openssl/MacOS/Randomizer.h
new file mode 100644
index 0000000..7c8b076
--- /dev/null
+++ b/openssl/MacOS/Randomizer.h
@@ -0,0 +1,42 @@
+
+// Gathers unpredictable system data to be used for generating
+// random bits
+
+#include <MacTypes.h>
+
+class CRandomizer {
+ public:
+ CRandomizer(void);
+ void PeriodicAction(void);
+
+ private:
+
+ // Private calls
+
+ void AddTimeSinceMachineStartup(void);
+ void AddAbsoluteSystemStartupTime(void);
+ void AddAppRunningTime(void);
+ void AddStartupVolumeInfo(void);
+ void AddFiller(void);
+
+ void AddCurrentMouse(void);
+ void AddNow(double millisecondUncertainty);
+ void AddBytes(void *data, long size, double entropy);
+
+ void GetTimeBaseResolution(void);
+ unsigned long SysTimer(void);
+
+ // System Info
+ bool mSupportsLargeVolumes;
+ bool mIsPowerPC;
+ bool mIs601;
+
+ // Time info
+ double mTimebaseTicksPerMillisec;
+ unsigned long mLastPeriodicTicks;
+
+ // Mouse info
+ long mSamplePeriod;
+ Point mLastMouse;
+ long mMouseStill;
+};