-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPRNGState.h
More file actions
28 lines (22 loc) · 749 Bytes
/
PRNGState.h
File metadata and controls
28 lines (22 loc) · 749 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef PRNGSTATE_H
#define PRNGSTATE_H
#include <inttypes.h>
#include "Generator.h"
#include "Pool.h"
#define POOL_SIZE 32
class PRNGState {
public:
PRNGState();
~PRNGState();
Pool* getPool(uint8_t poolNumber);
void reseed(uint8_t *entropy, uint16_t entropySize) { generator.reseedGenerator(entropy, entropySize);addToReseedCount();}
uint16_t getReseedCount() { return reseedCount;}
void addToReseedCount() { ++reseedCount;}
uint8_t* generateRandomData(uint16_t numberOfBytes,uint8_t *randomBytes){return generator.generateRandomData(numberOfBytes, randomBytes);}
uint8_t getPoolSize(){return POOL_SIZE;}
private:
Pool *pools;
uint16_t reseedCount;
Generator generator;
};
#endif /* PRNGSTATE_H */