Randomizer.h 891 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Gathers unpredictable system data to be used for generating
  2. // random bits
  3. #include <MacTypes.h>
  4. class CRandomizer {
  5. public:
  6. CRandomizer(void);
  7. void PeriodicAction(void);
  8. private:
  9. // Private calls
  10. void AddTimeSinceMachineStartup(void);
  11. void AddAbsoluteSystemStartupTime(void);
  12. void AddAppRunningTime(void);
  13. void AddStartupVolumeInfo(void);
  14. void AddFiller(void);
  15. void AddCurrentMouse(void);
  16. void AddNow(double millisecondUncertainty);
  17. void AddBytes(void *data, long size, double entropy);
  18. void GetTimeBaseResolution(void);
  19. unsigned long SysTimer(void);
  20. // System Info
  21. bool mSupportsLargeVolumes;
  22. bool mIsPowerPC;
  23. bool mIs601;
  24. // Time info
  25. double mTimebaseTicksPerMillisec;
  26. unsigned long mLastPeriodicTicks;
  27. // Mouse info
  28. long mSamplePeriod;
  29. Point mLastMouse;
  30. long mMouseStill;
  31. };