Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'CPP/7zip/Crypto/Hash/RandGen.h')
-rwxr-xr-xCPP/7zip/Crypto/Hash/RandGen.h21
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