aboutsummaryrefslogtreecommitdiffstats
path: root/MacOS/Randomizer.h
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2000-02-29 15:18:46 +0000
committerAndy Polyakov <appro@openssl.org>2000-02-29 15:18:46 +0000
commit0ea346557670b5aa598c06b50923458f131a5709 (patch)
tree86a5bc6c025db4266b4961948d33a77ab0b2c33e /MacOS/Randomizer.h
parent96723a3a68657ee94a1a16bef1900549c4d57e1d (diff)
downloadopenssl-0ea346557670b5aa598c06b50923458f131a5709.tar.gz
MacOS pseudo-random entropy collector.
Submitted by: Yoram Meroz <yoram@mail.idrive.com> Reviewed by: <appro>
Diffstat (limited to 'MacOS/Randomizer.h')
-rw-r--r--MacOS/Randomizer.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/MacOS/Randomizer.h b/MacOS/Randomizer.h
new file mode 100644
index 0000000000..565537b15d
--- /dev/null
+++ b/MacOS/Randomizer.h
@@ -0,0 +1,43 @@
+
+// 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;
+};