37 #ifndef VIRGIL_CRYPTO_VIRGIL_HASH_H
38 #define VIRGIL_CRYPTO_VIRGIL_HASH_H
40 #include "../VirgilByteArray.h"
44 namespace virgil {
namespace crypto {
inline namespace primitive {
72 self_->doUpdate(data);
73 return self_->doFinish();
88 self_->doUpdate(data);
96 return self_->doFinish();
111 *
this = std::move(tmp);
122 virtual Concept* doCopy()
const = 0;
124 virtual void doStart() = 0;
130 virtual ~Concept() noexcept = default;
134 struct Model : Concept {
136 explicit Model(Impl impl) : impl_(std::move(impl)) {}
138 Concept* doCopy()
const override {
139 return new Model(*
this);
142 void doStart()
override {
143 return impl_.start();
151 return impl_.finish();
159 std::unique_ptr<Concept> self_;
164 #endif //VIRGIL_CRYPTO_VIRGIL_HASH_H
Define proxy interface for the Hash (Message Digest) functionality.
Definition: VirgilOperationHash.h:51
VirgilByteArray finish()
Finalize hashing.
Definition: VirgilOperationHash.h:95
void update(const VirgilByteArray &data)
Hash new portion of the data.
Definition: VirgilOperationHash.h:87
std::vector< unsigned char > VirgilByteArray
This type represents a sequence of bytes.
Definition: VirgilByteArray.h:50
VirgilOperationHash(Impl impl)
Captures implementation object.
Definition: VirgilOperationHash.h:63
VirgilByteArray hash(const VirgilByteArray &data)
Calculate digest for given data.
Definition: VirgilOperationHash.h:70
static VirgilOperationHash getDefault()
Return default implementation.
void start()
Prepare internal state for the new hashing.
Definition: VirgilOperationHash.h:79