diff options
Diffstat (limited to 'CPP/7zip/Crypto/Hash/RandGen.h')
-rwxr-xr-x | CPP/7zip/Crypto/Hash/RandGen.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/CPP/7zip/Crypto/Hash/RandGen.h b/CPP/7zip/Crypto/Hash/RandGen.h new file mode 100755 index 00000000..3b58a032 --- /dev/null +++ b/CPP/7zip/Crypto/Hash/RandGen.h @@ -0,0 +1,21 @@ +// RandGen.h + +#ifndef __RANDGEN_H +#define __RANDGEN_H + +#include "Sha1.h" + +class CRandomGenerator +{ + Byte _buff[NCrypto::NSha1::kDigestSize]; + bool _needInit; + + void Init(); +public: + CRandomGenerator(): _needInit(true) {}; + void Generate(Byte *data, unsigned int size); +}; + +extern CRandomGenerator g_RandomGenerator; + +#endif |