make internal sha1 & sha512 implementation declarations match libcrypto api

This commit is contained in:
Andrei Kurushin 2016-12-28 00:31:01 +03:00 committed by Arvid Norberg
parent f1e34dfbd5
commit 08aab3a879
4 changed files with 6 additions and 6 deletions

View File

@ -29,7 +29,7 @@ namespace libtorrent
// we don't want these to clash with openssl's libcrypto
TORRENT_EXTRA_EXPORT void SHA1_init(sha1_ctx* context);
TORRENT_EXTRA_EXPORT void SHA1_update(sha1_ctx* context
, std::uint8_t const* data, std::uint32_t len);
, std::uint8_t const* data, size_t len);
TORRENT_EXTRA_EXPORT void SHA1_final(std::uint8_t* digest, sha1_ctx* context);
}

View File

@ -16,7 +16,7 @@ namespace libtorrent
TORRENT_EXTRA_EXPORT int SHA512_init(sha512_ctx* context);
TORRENT_EXTRA_EXPORT int SHA512_update(sha512_ctx* context
, std::uint8_t const* data, std::uint32_t len);
, std::uint8_t const* data, size_t len);
TORRENT_EXTRA_EXPORT int SHA512_final(std::uint8_t* digest, sha512_ctx* context);
}

View File

@ -135,10 +135,10 @@ namespace
#endif
template <class BlkFun>
void internal_update(sha1_ctx* context, u8 const* data, u32 len)
void internal_update(sha1_ctx* context, u8 const* data, size_t len)
{
using namespace std;
u32 i, j; // JHB
size_t i, j; // JHB
#ifdef VERBOSE
SHAPrintContext(context, "before");
@ -191,7 +191,7 @@ void SHA1_init(sha1_ctx* context)
// Run your data through this.
void SHA1_update(sha1_ctx* context, u8 const* data, u32 len)
void SHA1_update(sha1_ctx* context, u8 const* data, size_t len)
{
// GCC standard defines for endianness
// test with: cpp -dM /dev/null

View File

@ -184,7 +184,7 @@ int SHA512_init(sha512_ctx* md) {
@param inlen The length of the data (octets)
@return 0 if successful
*/
int SHA512_update(sha512_ctx* md, std::uint8_t const* in, std::uint32_t inlen)
int SHA512_update(sha512_ctx* md, std::uint8_t const* in, size_t inlen)
{
size_t n;
size_t i;