/* */ #ifndef D_LIBNETTLE_MESSAGE_DIGEST_IMPL_H #define D_LIBNETTLE_MESSAGE_DIGEST_IMPL_H #include "common.h" #include #include #include "SharedHandle.h" namespace aria2 { class MessageDigestImpl { private: const nettle_hash* hashInfo_; char* ctx_; MessageDigestImpl(const nettle_hash* hashInfo); // We don't implement copy ctor. MessageDigestImpl(const MessageDigestImpl&); // We don't implement assignment operator. MessageDigestImpl& operator==(const MessageDigestImpl&); public: ~MessageDigestImpl(); static SharedHandle sha1(); static SharedHandle create(const std::string& hashType); static bool supports(const std::string& hashType); static size_t getDigestLength(const std::string& hashType); size_t getDigestLength() const; void reset(); void update(const void* data, size_t length); void digest(unsigned char* md); }; } // namespace aria2 #endif // D_LIBNETTLE_MESSAGE_DIGEST_IMPL_H