Пример #1
0
		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;
		}
Пример #2
0
	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
		}
	}
Пример #3
0
		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;
		}
Пример #4
0
	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;
	}