37 #ifndef VIRGIL_CRYPTO_FOUNDATION_VIRGIL_HASH_H 38 #define VIRGIL_CRYPTO_FOUNDATION_VIRGIL_HASH_H 43 #include "../VirgilByteArray.h" 44 #include "asn1/VirgilAsn1Compatible.h" 46 namespace virgil {
namespace crypto {
namespace foundation {
103 std::string
name()
const;
236 size_t childWrittenBytes = 0)
const override;
255 void checkState()
const;
260 std::unique_ptr<Impl> impl_;
int type() const
Return underlying hash type.
void start()
Initialize hashing for the new message hash.
Algorithm
Enumerates possible Hash algorithms.
Definition: VirgilHash.h:57
This class provides methods for reading ASN.1 data structure.
Definition: VirgilAsn1Reader.h:53
This class provides interface that allow to save and restore object state in the ASN.1 structure.
Definition: VirgilAsn1Compatible.h:59
Provides hashing (message digest) algorithms.
Definition: VirgilHash.h:52
size_t asn1Write(virgil::crypto::foundation::asn1::VirgilAsn1Writer &asn1Writer, size_t childWrittenBytes=0) const override
Write object state to the writer.
Definition: VirgilHash.h:265
This class provides methods for writing ASN.1 data structure.
Definition: VirgilAsn1Writer.h:54
VirgilHash()
Create object with undefined algorithm.
size_t size() const
Return size of the message digest output.
Root namespace for all Virgil Security libraries.
Definition: VirgilAsn1Compatible.h:46
void hmacUpdate(const virgil::crypto::VirgilByteArray &data)
Update / process message HMAC hash.
std::vector< unsigned char > VirgilByteArray
This type represents a sequence of bytes.
Definition: VirgilByteArray.h:50
string to_string(virgil::crypto::foundation::VirgilHash::Algorithm alg)
Returns string representation of the Hash algorithm.
void hmacReset()
Reset HMAC hashing for the new message hash.
std::string name() const
Returns name of the hash function.
void update(const virgil::crypto::VirgilByteArray &data)
Update / process message hash.
virgil::crypto::VirgilByteArray hmacFinish()
Return final message HMAC hash.
Algorithm algorithm() const
Returns algorithm of the hash function.
void hmacStart(const virgil::crypto::VirgilByteArray &key)
Initialize HMAC hashing for the new message hash.
void asn1Read(virgil::crypto::foundation::asn1::VirgilAsn1Reader &asn1Reader) override
Read object state from the reader.
virgil::crypto::VirgilByteArray hmac(const virgil::crypto::VirgilByteArray &key, const virgil::crypto::VirgilByteArray &data) const
Produce HMAC hash.
virgil::crypto::VirgilByteArray hash(const virgil::crypto::VirgilByteArray &data) const
Produce hash.
virgil::crypto::VirgilByteArray finish()
Return final message hash.