Commit Graph

336 Commits

Author SHA1 Message Date
surtur 64d7a389ad
generator: add service method prototype 2022-01-02 07:40:59 +01:00
surtur aeed19ef40
entropy_src: add max_event_length variable 2022-01-02 07:35:00 +01:00
surtur 56b1773c28
accumulator: make ctor noexcept 2022-01-02 07:21:25 +01:00
surtur 1a325193b0
accumulator: add prototypes of service methods 2022-01-02 07:13:12 +01:00
surtur f3a9ee0d91
do_task: add a constructor 2022-01-02 07:12:14 +01:00
surtur e5cba7e261
accumulator: add wait_for() 2022-01-01 09:23:42 +01:00
surtur 16da8fb3cf
util: add current_time() 2022-01-01 09:07:28 +01:00
surtur 934c658fde
util: add gen_block_size field 2022-01-01 08:19:50 +01:00
surtur 71207ed742
refactor(pre-commit): split the test target 2022-01-01 07:45:41 +01:00
surtur 3d125af2ed
refactor(DoTask): formatting and naming 2022-01-01 07:38:06 +01:00
surtur 55cb3b6ec7
chore(cmake): improve legibility 2022-01-01 07:11:21 +01:00
surtur 928011dd54
chore(cmake): record gcc switches for debugging 2021-12-30 22:34:22 +01:00
surtur 6408b1ded7
add fmtlog library
"fmtlog is a performant fmtlib-style logging library with latency in nanoseconds."
ref: https://github.com/MengRao/fmtlog
2021-12-30 22:30:41 +01:00
surtur 81e627998e
refactor(SeedFileManager) 2021-12-29 04:51:40 +01:00
surtur 56e6aa6b15
pre-commit: no need for args
as per the website:
  When creating local hooks, there's no reason to put command arguments
  into args as there is nothing which can override them -- instead put
  your arguments directly in the hook entry.

ref: https://pre-commit.com/#arguments-pattern-in-hooks

also add some little niceness to 'make test'
2021-12-29 04:45:23 +01:00
surtur b5601acfbd
refactor: non-semantic cleanup 2021-12-29 03:55:01 +01:00
surtur 2086861776
accumulator: implement add_source() 2021-12-29 03:49:36 +01:00
surtur 234b87ff1f
accumulator: use a Generator pointer 2021-12-29 02:56:57 +01:00
surtur 01c402300c
accumulator: add generator-interacting methods
..and a way to work with the generator
2021-12-13 13:22:50 +01:00
surtur 129516a48f
add seed_file_management.h holding SeedFileManager 2021-12-13 05:59:27 +01:00
surtur 04bbf16731
pool: set_s -> append_s as it fits better 2021-12-13 05:24:59 +01:00
surtur af1b4cf5ad
pool: make get_id const as it just reads 2021-12-13 05:24:17 +01:00
surtur 7eaaef2fdb
fortuna: handle reseeds+clear pools for seed
* actually clear out entropy of the pools before a reseed
* correctly prepare the seed for the reseed
* add a couple of helper methods to Pool that assist with getting
  length, retrieving and clearing of the collected entropy
* catch exceptions in main(), handle them gracefully
2021-12-13 05:11:17 +01:00
surtur 65c476dbd6
add Util class + perform general refactor
* rm duplicate do_sha() code, consolidate in Util
* make reseed() public so that it can be called from outside
* rm reseed() from do_crypto() where it has no place
2021-12-13 05:10:07 +01:00
surtur da48e61cc2
add da_threading lib
retrieved from https://stackoverflow.com/a/46135882
original author LWimsey <https://stackoverflow.com/users/6651824/lwimsey> (c) 2017
edited and made into a header-only lib by wanderer <a_mirre at utb.cz> (c) 2021
2021-12-12 22:50:06 +01:00
surtur cf41d323a4
fortuna: add task runner "do_task"; link pthread 2021-12-12 18:42:47 +01:00
surtur 2a67a37cbe
generator: add is_seeded method 2021-12-12 18:40:29 +01:00
surtur b55ca33e24
chore(fortuna): add random_data() checks, batch 1 2021-12-12 06:14:58 +01:00
surtur d907c9db6e
generator: tweak generate_random_data logic 2021-12-11 21:33:42 +01:00
surtur fb02ef9a23
generator: make dtor noexcept 2021-12-11 20:43:48 +01:00
surtur 55a19e6681
chore(event_adder_impl): pool int -> uint8_t 2021-12-11 20:16:24 +01:00
surtur 2d20242b3e
accumulator(pool): (partly) implement add_entropy 2021-12-11 02:53:47 +01:00
surtur 0ccd60ce1b
Merge branch 'fixing-generator' into add-random-sources
* fixing-generator:
  generator: use a proper uin64_t literal
  chore(generator): erase -> clear
  generator: memcpy -> memmove
  fix(generator): incorrect copying, no protections
2021-12-11 02:35:06 +01:00
surtur a6719d4947
accumulator: add add_source 2021-12-11 02:27:52 +01:00
surtur d0e9b08886
accumulator: add urandom_entropy_src 2021-12-11 02:24:40 +01:00
surtur a5b988ba71
accumulator: add event_scheduler,entropy_src ifces 2021-12-11 02:12:49 +01:00
surtur 2fbf5464a0
fortuna: erase -> clear 2021-12-11 01:20:34 +01:00
surtur 25cbddf41f
generator: use a proper uin64_t literal 2021-12-11 01:13:01 +01:00
surtur b9676226c5
chore(generator): erase -> clear 2021-12-11 01:10:14 +01:00
surtur a7e8caa26e
generator: memcpy -> memmove 2021-12-11 01:04:57 +01:00
surtur 595245fbce
fix(generator): incorrect copying, no protections
* use try-catch whenever possible
* perform memcpy operations in the right direction
* make greater use of local constants
* use more of the braced initializations
* there were memcpy operations of incorrect sizes in place, particularly
  in regard to generator key (G.k) and counter (G.ctr), which resulted
  in key bytes being set to garbage
2021-12-10 20:02:30 +01:00
surtur 801d605e2a
chore(clang-tidy): unify flags
also add a status message to CMake's output
2021-12-10 18:57:25 +01:00
surtur 053d2187a2
chore(accumulator): make use of init_pool_num 2021-12-09 14:11:39 +01:00
surtur 8b4cd4b6e8
fortuna(random_data): time-tracking precision++
using floats does wonders
2021-12-08 23:17:37 +01:00
surtur 82288fe20d
chore(event_adder_impl): reuse constant p_size
size of pools array will stay the same anyway
2021-12-08 04:19:22 +01:00
surtur c401a47ca7
event_adder_impl: loop with a pre-computed value 2021-12-08 04:07:14 +01:00
surtur 872e6f7f9f
add event_adder_impl 2021-12-08 03:58:18 +01:00
surtur 33f6620662
chore(pool): stop spamming at initialization 2021-12-08 03:40:08 +01:00
surtur 0e3caebb6d
chore(fortuna): formatting
[skip ci]
2021-12-08 03:31:47 +01:00
surtur f02952d72a
fortuna(random_data): add basic time tracking 2021-12-07 15:55:29 +01:00