32 lines
632 B
C++
32 lines
632 B
C++
#ifndef MESSAGEDIGEST_H
|
|
#define MESSAGEDIGEST_H
|
|
|
|
#include <cstddef>
|
|
|
|
class MessageDigestPrivate;
|
|
|
|
class MessageDigest {
|
|
|
|
public:
|
|
enum Type {
|
|
MD_NONE = 0,
|
|
MD_MD5,
|
|
MD_SHA1,
|
|
MD_SHA224,
|
|
MD_SHA256,
|
|
MD_SHA384,
|
|
MD_SHA512,
|
|
MD_RIPEMD160,
|
|
};
|
|
MessageDigest(Type type);
|
|
~MessageDigest();
|
|
int hmacStarts(const unsigned char *key, size_t keylen);
|
|
int hmacUpdate(const unsigned char *input, size_t ilen);
|
|
int hmacFinish(unsigned char *output);
|
|
|
|
private:
|
|
MessageDigestPrivate *m_d{nullptr};
|
|
};
|
|
|
|
#endif // MESSAGEDIGEST_H
|