Commit Graph

15 Commits

Author SHA1 Message Date
c9398a0bf4
fix(sfm): use correct size in cast
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-24 19:25:04 +01:00
8b9fbe1e1e
sfm: add get_write_interval() const member func.
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-23 20:18:59 +01:00
52de785399
fortuna: properly handle reseeds
All checks were successful
continuous-integration/drone/push Build is passing
* 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
660afa8d5e
sfm(th): make is_job_running() const
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-21 05:35:47 +01:00
b5bf269494
sfm(th): add mtx,locks,l_guards;IS_RUNNING->atomic
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-21 05:32:23 +01:00
5da8023bd3
chore(sfm): move code inside a try block
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-20 05:45:27 +01:00
246995dab3
sfm: fix reads,writes of the seed file, refactor
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-20 05:36:06 +01:00
c615076182
chore(sfm): uint -> unsigned int
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-17 07:20:16 +01:00
f79395261f
sfm: smooth out yet other conversions
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-14 08:27:52 +01:00
7c6e53f31b
SeedFileManager: fix -Wshadow, -Wconversion
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-14 07:58:55 +01:00
d6e97e3fda
SeedFileManager: initialize RUNNING with constinit
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-13 06:18:43 +01:00
a0df93c9ec
clang-format: BinPack{Arguments,Parameters}: false
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-13 06:04:18 +01:00
226a5c2c6c
sfm: improve the job "RUNNING" logic, use static
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-13 02:49:45 +01:00
4b216a6f6e
refactor: clang-format
All checks were successful
continuous-integration/drone/push Build is passing
2022-01-10 04:25:03 +01:00
795b9ffe54
add proper SeedFileManager implementation
All checks were successful
continuous-integration/drone/push Build is passing
a couple of fixes/necessary additions were made along the way, namely:
* add a default constructor for DoTask
* rework of the mutex/lock_guard/unique_lock logic in generator/fortuna
* add .fortuna.seed to the list of the ignored (.gitignore)
* add helper function to util for convertin bytes to blocks (16b==block)
* add a wrapper for around the SeedFileManager instance and a way to see
  if it's dead or alive (so that it can be restarted if needed)
* the timeout for saving of the seed file has been decreased to a more
  reasonable value than 10 minutes (I wouldn't want to lose potentially
  up to 10 minutes worth of entropy)
2022-01-09 11:58:38 +01:00