Randomizer.h 850 B

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