Example #1
0
	hasher512::hasher512()
	{
#ifdef TORRENT_USE_LIBGCRYPT
		gcry_md_open(&m_context, GCRY_MD_SHA512, 0);
#elif TORRENT_USE_COMMONCRYPTO
		CC_SHA512_Init(&m_context);
#elif TORRENT_USE_CRYPTOAPI_SHA_512
#elif defined TORRENT_USE_LIBCRYPTO
		SHA512_Init(&m_context);
#else
		SHA512_init(&m_context);
#endif
	}
Example #2
0
	hasher512::hasher512()
	{
#ifdef TORRENT_USE_LIBGCRYPT
		gcry_md_open(&m_context, GCRY_MD_SHA512, 0);
#elif TORRENT_USE_COMMONCRYPTO
		CC_SHA512_Init(&m_context);
#elif TORRENT_USE_CRYPTOAPI
		if (CryptCreateHash(get_crypt_provider(), CALG_SHA_512, 0, 0, &m_context) == false)
		{
#ifndef BOOST_NO_EXCEPTIONS
			throw system_error(error_code(GetLastError(), system_category()));
#else
			std::terminate();
#endif
		}
#elif defined TORRENT_USE_LIBCRYPTO
		SHA512_Init(&m_context);
#else
		SHA512_init(&m_context);
#endif
	}