-
Notifications
You must be signed in to change notification settings - Fork 0
/
Generator.h
41 lines (33 loc) · 960 Bytes
/
Generator.h
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef GENERATOR_H
#define GENERATOR_H
#include "GeneratorState.h"
#include "sha256.h"
#include "AES.h"
#include <inttypes.h>
#include <math.h>
#if defined(ARDUINO) && ARDUINO >= 100
#include <Arduino.h>
#else
#include <algorithm>
#endif
//#include <WProgram.h>
//#define MAX_BLOCK_GENERATE_SIZE 8 //This can be adjusted but if it is more could cause memmory issues
class Generator {
public:
Generator();
~Generator();
void reseedGenerator(uint8_t* seed, uint16_t seedSize);
uint8_t* generateRandomData(uint32_t numberOfBytes,uint8_t *randomBytes);
uint8_t* getCount() { return generatorState.getCount();}
// bool isAvaliable() {
// return generatorState.getReseedCount();
// }
private:
bool generateBlocks(uint8_t numberOfBlocks, uint8_t* pseudroRandomData);
GeneratorState generatorState;
AES aes;
Sha256Class sha;
uint8_t *cipherText;
uint8_t *aesPlainText; // reuse the values;
};
#endif