2016-08-26 01:07:16 +02:00
|
|
|
#ifndef TORRENT_SHA512_HPP_INCLUDED
|
|
|
|
#define TORRENT_SHA512_HPP_INCLUDED
|
|
|
|
|
|
|
|
#include "libtorrent/config.hpp"
|
2019-02-12 11:26:05 +01:00
|
|
|
|
|
|
|
#if !defined TORRENT_USE_LIBGCRYPT \
|
|
|
|
&& !TORRENT_USE_COMMONCRYPTO \
|
|
|
|
&& !TORRENT_USE_CRYPTOAPI_SHA_512 \
|
|
|
|
&& !defined TORRENT_USE_LIBCRYPTO
|
|
|
|
|
2016-08-26 01:07:16 +02:00
|
|
|
#include <cstdint>
|
|
|
|
|
2017-04-12 19:00:57 +02:00
|
|
|
namespace libtorrent {
|
2016-08-26 01:07:16 +02:00
|
|
|
|
|
|
|
struct sha512_ctx
|
|
|
|
{
|
2017-09-12 23:10:11 +02:00
|
|
|
std::uint64_t length;
|
|
|
|
std::uint64_t state[8];
|
2017-01-13 14:44:08 +01:00
|
|
|
std::size_t curlen;
|
2016-08-26 01:07:16 +02:00
|
|
|
std::uint8_t buf[128];
|
|
|
|
};
|
|
|
|
|
|
|
|
TORRENT_EXTRA_EXPORT int SHA512_init(sha512_ctx* context);
|
|
|
|
TORRENT_EXTRA_EXPORT int SHA512_update(sha512_ctx* context
|
2017-01-13 14:44:08 +01:00
|
|
|
, std::uint8_t const* data, std::size_t len);
|
2016-08-26 01:07:16 +02:00
|
|
|
TORRENT_EXTRA_EXPORT int SHA512_final(std::uint8_t* digest, sha512_ctx* context);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2019-02-12 11:26:05 +01:00
|
|
|
#endif
|