37 #ifndef VIRGIL_CRYPTO_VIRGIL_RANDOM_H 38 #define VIRGIL_CRYPTO_VIRGIL_RANDOM_H 40 #include "../VirgilByteArray.h" 44 namespace virgil {
namespace crypto {
inline namespace primitive {
71 return self_->doRandomize(bytesNum);
86 *
this = std::move(tmp);
99 virtual Concept* doCopy()
const = 0;
101 virtual ~Concept() noexcept =
default;
104 template<
class Random>
105 struct Model : Concept {
106 explicit Model(Random randomImpl) : impl_(std::move(randomImpl)) {}
109 return impl_.randomize(bytesNum);
112 Concept* doCopy()
const override {
113 return new Model(*
this);
121 std::unique_ptr<Concept> self_;
126 #endif //VIRGIL_CRYPTO_VIRGIL_RANDOM_H VirgilByteArray randomize(size_t bytesNum)
Return random sequence.
Definition: VirgilOperationRandom.h:70
Definition: VirgilHash.h:265
Root namespace for all Virgil Security libraries.
Definition: VirgilAsn1Compatible.h:46
static VirgilOperationRandom getDefault()
Return default implementation.
std::vector< unsigned char > VirgilByteArray
This type represents a sequence of bytes.
Definition: VirgilByteArray.h:50
Define proxy interface for the Randomization functionality.
Definition: VirgilOperationRandom.h:51
VirgilOperationRandom(Impl impl)
Captures implementation object.
Definition: VirgilOperationRandom.h:63