Virgil Security Crypto library  2.5.0-rc1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
VirgilRandom.h
1 
37 #ifndef VIRGIL_CRYPTO_FOUNDATION_VIRGIL_RANDOM_H
38 #define VIRGIL_CRYPTO_FOUNDATION_VIRGIL_RANDOM_H
39 
40 #include <cstdlib>
41 #include <memory>
42 
43 #include "../VirgilByteArray.h"
44 
45 namespace virgil { namespace crypto { namespace foundation {
46 
50 class VirgilRandom {
51 public:
66  static void setSeedFile(std::string path);
67 
76  static size_t seedFileLengthMin();
77 
78 public:
82 
88  explicit VirgilRandom(const virgil::crypto::VirgilByteArray& personalInfo);
94  explicit VirgilRandom(const std::string& personalInfo);
96 
100 
108 
114  size_t randomize();
115 
126  size_t randomize(size_t min, size_t max);
128 
129 public:
131  VirgilRandom(VirgilRandom&& rhs) noexcept;
132 
133  VirgilRandom& operator=(VirgilRandom&& rhs) noexcept;
134 
135  virtual ~VirgilRandom() noexcept;
136 
137  VirgilRandom(const VirgilRandom& rhs);
138 
139  VirgilRandom& operator=(const VirgilRandom& rhs);
140 
142 
143 private:
144  void init();
145 
146 private:
147  class Impl;
148 
149  std::unique_ptr<Impl> impl_;
150 };
151 
152 }}}
153 
154 #endif /* VIRGIL_CRYPTO_FOUNDATION_VIRGIL_RANDOM_H */
Provides randomization algorithm.
Definition: VirgilRandom.h:50
VirgilRandom(const virgil::crypto::VirgilByteArray &personalInfo)
Initialize randomization module with personalization data.
std::vector< unsigned char > VirgilByteArray
This type represents a sequence of bytes.
Definition: VirgilByteArray.h:50
static void setSeedFile(std::string path)
Configure path to the file that is used as a seed for a non-volatile entropy source.