Commit Graph

336 Commits

Author SHA1 Message Date
surtur 8f0f29d190
generator: make some internal vars const 2022-01-26 22:43:22 +01:00
surtur c40806e68d
generator: create permanent Serpent encryption obj 2022-01-26 22:35:45 +01:00
surtur 1517b150ed
cmake: CMAKE_BUILD_TYPE MATCHES -> STREQUAL 2022-01-26 17:07:34 +01:00
surtur c9398a0bf4
fix(sfm): use correct size in cast 2022-01-24 19:25:04 +01:00
surtur 7d856dab8e
cmake: use clang-tidy with extra-arg '-std=c++20' 2022-01-24 10:31:16 +01:00
surtur a3251a7c8b
fix(pool): properly encode full event 2022-01-24 03:55:19 +01:00
surtur d401bb6c25
add chance namespace; handle signals 2022-01-23 22:22:28 +01:00
surtur 710ee80f91
chore(pool): format 2022-01-23 22:12:17 +01:00
surtur a68166da57
fortuna: run svcs while(continue_running.load()) 2022-01-23 20:47:42 +01:00
surtur 5693b24ee0
fortuna: sleep only if sfm svc is running 2022-01-23 20:45:06 +01:00
surtur 2c56d9af27
fortuna: std::atomic<bool> continue_running 2022-01-23 20:39:11 +01:00
surtur e706de7702
fortuna: use a once_flag in initialize_prng() 2022-01-23 20:37:15 +01:00
surtur 01de51dc73
fortuna: assert i==Accumulator::init_pool_num==0 2022-01-23 20:31:58 +01:00
surtur f48927738d
sfm: assert checkup_interval < seed_write_interval 2022-01-23 20:27:14 +01:00
surtur 8b9fbe1e1e
sfm: add get_write_interval() const member func. 2022-01-23 20:18:59 +01:00
surtur b8f76886eb
sfm: make write_interval const, as in unchanging 2022-01-23 20:17:36 +01:00
surtur fa4c9d048e
fortuna: use die_point latch
wait on the latch in Fortuna's dtor until threads finish execution
2022-01-23 20:11:11 +01:00
surtur 680272bed4
fortuna: thread -> jthread; add die_point latch 2022-01-23 20:07:49 +01:00
surtur 06deab6ef1
chore(fortuna): make sync_point latch private 2022-01-23 20:00:30 +01:00
surtur 47e893b674
accumulator: rm commented std::move(&gen) 2022-01-22 21:42:44 +01:00
surtur 3bf79b49fd
accumulator: make reg bool atomic 2022-01-22 21:39:45 +01:00
surtur 9f95ebe3b1
pool: make all_ok atomic 2022-01-22 21:33:49 +01:00
surtur e452a63b4a
pool: add call_once to initialize_pool() mem. fun
* also protect set_id() member function with a std::lock_guard, which
  holds mtx for the time of initialization
2022-01-22 21:17:36 +01:00
surtur 14462e6b16
chore(pool): rm unimportant print statements 2022-01-22 20:40:47 +01:00
surtur 4f5072d276
fortuna: add final specifier 2022-01-22 20:18:46 +01:00
surtur 65abd3b2f3
chore: rm redundant da_pools, using shared_ptr 2022-01-22 19:57:51 +01:00
surtur 580531acf2
chore: rm {accumulator,generator}_service, threads 2022-01-22 19:27:58 +01:00
surtur 52de785399
fortuna: properly handle reseeds
* move reseed_ctr and related member functions to Accumulator

* create a std::shared_ptr<Accumulator> to Fortuna's internal
  Accumulator object and feed that into SeedFileManager instead of a
  reference, which used to get copied to a new object in SeedFileManager

* make Accumulator non-copyable, since it's only to be created once.
  instead, a shared_ptr is used to facilitate multiple-access

* handle concurrency in Accumulator as the reseed_ctr-related functions
  can now be accessed from both Fortuna and SeedFileManager, declare mtx
  as mutable (since it's also used in a const function)

* use std::scoped_lock in 'initialize_prng()' to safely lock both mutexes
2022-01-22 18:36:51 +01:00
surtur 760fd1bd9c
fortuna: std::unique_lock x2 -> std::scoped_lock 2022-01-21 20:55:44 +01:00
surtur 4c77810535
chore(fortuna): lock print_mtx in {} scopes 2022-01-21 20:44:24 +01:00
surtur 3db8100089
chore(fortuna): rm dbg l_ctr 2022-01-21 19:51:54 +01:00
surtur f6b06cd675
makefile: build in tmp when not in CI 2022-01-21 19:14:55 +01:00
surtur 54f52b8a21
makefile: let make-tidy have it's own build folder 2022-01-21 16:32:19 +01:00
surtur 11931ff3b1
fortuna: fix accu thread joiner check in dtor 2022-01-21 16:03:26 +01:00
surtur b24cf7566a
fortuna: move whole ctor code into a try block 2022-01-21 06:31:46 +01:00
surtur c852c723fd
fortuna: update the init-latch logic 2022-01-21 06:27:06 +01:00
surtur 6c68efc6ee
chore(.pre-commit-config.yaml): bump hook versions 2022-01-21 05:44:28 +01:00
surtur fa81ac6f46
chore: update fmt submodule to c2850055 2022-01-21 05:39:24 +01:00
surtur 660afa8d5e
sfm(th): make is_job_running() const 2022-01-21 05:35:47 +01:00
surtur b5bf269494
sfm(th): add mtx,locks,l_guards;IS_RUNNING->atomic 2022-01-21 05:32:23 +01:00
surtur b7c7558e1f
DoTask: timed_mutex -> recursive_timed_mutex 2022-01-21 02:54:15 +01:00
surtur 977a705cd3
pool: place recursive_mtx at the start of func 2022-01-20 08:44:25 +01:00
surtur 606527618d
gen: simplify time_to_reseed() return logic 2022-01-20 08:40:42 +01:00
surtur 674ceedc4a
gen: mtx -> mutable recursive_mtx to all functions 2022-01-20 08:36:02 +01:00
surtur 56d9631f84
fortuna: add mtx_{accu,p_pools}, locks 2022-01-20 08:14:40 +01:00
surtur 3b537e1e26
fortuna: add thread-synchronising latch 2022-01-20 08:08:11 +01:00
surtur 5b1c9ba71c
fortuna: make sleep_time vars constexpr 2022-01-20 08:00:16 +01:00
surtur 4c7e95e475
fortuna: add mtx_random_data 2022-01-20 07:55:21 +01:00
surtur a3f871a644
fortuna: move code into a try block 2022-01-20 06:06:07 +01:00
surtur 4f28612f3f
fortuna: add const and casts where appropriate 2022-01-20 05:58:36 +01:00