Commit Graph

14 Commits

Author SHA1 Message Date
surtur ffca8a8d37
main: use moar_random_data() 2022-02-03 03:15:53 +01:00
surtur a6f9fb5e8c
chance: add lil_demo() fun 2022-02-03 03:05:09 +01:00
surtur a3daa722da
chore: print info msgs to stderr 2022-02-03 00:37:20 +01:00
surtur c9218e47e8
chore(main): rm unused var 2022-01-27 21:22:50 +01:00
surtur d401bb6c25
add chance namespace; handle signals 2022-01-23 22:22:28 +01:00
surtur 3e4fb10414
fortuna: add generator service 2022-01-03 07:49:53 +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 0c2a1c6744
finalise generator
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
2021-11-30 14:09:39 +01:00
surtur bd421295c4
feat: use fmt instead of iostreams
switch to fmt - "A modern formatting library" - for fun and profit,
currently in header-only configuration.

ref: https://github.com/fmtlib/fmt

closes #5
closes #4
2021-11-18 22:05:05 +01:00
surtur 20c22fef47
chore(main): don't directly work with Generator 2021-11-15 22:05:07 +01:00
surtur ea11801789
add fortuna class 2021-11-10 23:58:42 +01:00
surtur f64295f052
move to oop paradigm
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
2021-11-03 02:57:23 +01:00
surtur 7d123ce639
main.cpp: switch to a using declaration
..instead of pulling the whole namespace
2021-11-02 04:40:08 +01:00
surtur c44fa825c4
initial commit 2021-10-24 21:29:49 +02:00