HCRYPTHASH duplicate(crypt_hash const& h) { HCRYPTHASH ret; if (CryptDuplicateHash(h.m_hash, 0, 0, &ret) == false) { throw_ex<system_error>(error_code(GetLastError(), system_category())); } return ret; }
hasher512::hasher512(hasher512 const& h) { if (CryptDuplicateHash(h.m_context, 0, 0, &m_context) == false) { #ifndef BOOST_NO_EXCEPTIONS throw system_error(error_code(GetLastError(), system_category())); #else std::terminate(); #endif } }
HCRYPTHASH duplicate(crypt_hash const& h) { HCRYPTHASH ret; if (CryptDuplicateHash(h.m_hash, 0, 0, &ret) == false) { #ifndef BOOST_NO_EXCEPTIONS throw system_error(error_code(GetLastError(), system_category())); #else std::terminate(); #endif } return ret; }
hasher512& hasher512::operator=(hasher512 const& h) { if (this == &h) return *this; CryptDestroyHash(m_context); if (CryptDuplicateHash(h.m_context, 0, 0, &m_context) == false) { #ifndef BOOST_NO_EXCEPTIONS throw system_error(error_code(GetLastError(), system_category())); #else std::terminate(); #endif } return *this; }