/* */ #ifndef D_LIBSSL_MESSAGE_DIGEST_IMPL_H #define D_LIBSSL_MESSAGE_DIGEST_IMPL_H #include "common.h" #include #include #include "SharedHandle.h" namespace aria2 { class MessageDigestImpl { private: const EVP_MD* hashFunc_; EVP_MD_CTX ctx_; MessageDigestImpl(const EVP_MD* hashFunc); // 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_LIBSSL_MESSAGE_DIGEST_IMPL_H