1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
-
-
-
-
-
-
-
-
-
-
-
-
- #ifndef onetimepad_included
- #define onetimepad_included
-
- #include <vector>
- #include "mangler.hpp"
-
- using namespace std;
-
- typedef vector<unsigned char> PadBuffer;
-
- class OneTimePad {
- private:
- MANGLER PadGenerator;
- void addLightweightEntropy();
- PadBuffer Entropy(int Length = 1024);
-
- void* fill(void* Object, int Size);
-
- bool StrongEntropyFlag;
-
- public:
- OneTimePad();
-
- bool isStrong();
-
- PadBuffer Pad(int Length);
- void addEntropy();
- void addEntropy(PadBuffer Entropy);
-
- template <typename T>
- T& fill(T& Object) {
- fill((void*) &Object, sizeof(Object));
- return Object;
- }
-
- };
-
- #endif
|