Skip to content

Commit

Permalink
Add singleton for random pool
Browse files Browse the repository at this point in the history
  • Loading branch information
john0312 committed Jul 25, 2024
1 parent cf54650 commit 9efe979
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fw/Core/Hitcon/Logic/RandomPool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ using hitcon::service::sched::task_callback_t;

namespace hitcon {

FastRandomPool g_fast_random_pool;
SecureRandomPool g_secure_random_pool;

SecureRandomPool::SecureRandomPool()
: init_finished(false), seed_count(0),
routine_task(950, (task_callback_t)&SecureRandomPool::Routine, this, 20),
Expand Down
3 changes: 3 additions & 0 deletions fw/Core/Hitcon/Logic/RandomPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ class FastRandomPool {
PCG32 prng;
};

extern FastRandomPool g_fast_random_pool;
extern SecureRandomPool g_secure_random_pool;

} // namespace hitcon

#endif // LOGIC_RANDOM_POOL_DOT_H_

0 comments on commit 9efe979

Please sign in to comment.