* 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
commit a64b52e5a4
Author: surtur <a_mirre@utb.cz>
Date: Sun Nov 21 23:39:30 2021 +0100
finalise generator
this commit adds a (nearly) complete implementation of the generator.
* wrap calls to generator in a fortuna class method random_data
* calls generator's method generate_random_data, that internally calls
generate_blocks
* use a proper 256bit key in G_state
* add reseed method implementation
* call a reseed in initialize_generator
* do_sha returns proper digest now
* add proper do_crypto implementation
* call generate_blocks internally
* handle re-keying
* optimise header includes
TODO: there are still many commented (enabled on demand) debugging statements
-> TO BE REMOVED
switch to fmt - "A modern formatting library" - for fun and profit,
currently in header-only configuration.
ref: https://github.com/fmtlib/fmtcloses#5closes#4
squashed the following:
commit a28354d585
Author: surtur <a_mirre@utb.cz>
Date: Wed Nov 3 02:14:35 2021 +0100
chore: make G_state a private structure
* make G_state private
* move protected section behind private
* also do cleanup a little -> k and ctr won't exist as part of the
generator outside of the G_state struct
commit 926216fad3
Author: surtur <a_mirre@utb.cz>
Date: Wed Nov 3 01:37:28 2021 +0100
chore: make methods aware of objects
as a consequence we stopped returning the generator state from every
function and equally stopped using it as a parameter to every generator
method that handles the state in any way
commit 01eadae32f
Author: surtur <a_mirre@utb.cz>
Date: Tue Nov 2 05:10:58 2021 +0100
feat: move from structural to object paradigm
* declare and implement Generator class and member methods
* create an instance of Generator in main
* call initialize_generator() from main