forked from ak-fortuna/fortuna
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
This commit is contained in:
parent
926216fad3
commit
a28354d585
|
@ -22,8 +22,6 @@ void Generator::initialize_generator(){
|
|||
auto G = new Generator::G_state{};
|
||||
G->k = 0;
|
||||
G->ctr = 0;
|
||||
k = 0;
|
||||
ctr = 0;
|
||||
printf("Generator initialized\n");
|
||||
delete(G);
|
||||
};
|
||||
|
|
10
generator.h
10
generator.h
|
@ -12,13 +12,8 @@ class Generator {
|
|||
public:
|
||||
void initialize_generator();
|
||||
|
||||
protected:
|
||||
struct G_state;
|
||||
auto get_state() -> Generator::G_state;
|
||||
|
||||
private:
|
||||
int64_t k;
|
||||
unsigned __int128 ctr;
|
||||
struct G_state;
|
||||
|
||||
auto reseed(const string& s) -> void;
|
||||
|
||||
|
@ -31,6 +26,9 @@ private:
|
|||
/* n is the number of random bytes to generate */
|
||||
auto generate_random_data(uint n) -> string;
|
||||
|
||||
protected:
|
||||
auto get_state() -> Generator::G_state;
|
||||
|
||||
}; // class generator
|
||||
|
||||
} //namespace generator
|
||||
|
|
Loading…
Reference in New Issue