forked from premiere/premiere-libtorrent
make internal sha1 & sha512 implementation declarations match libcrypto api
This commit is contained in:
parent
f1e34dfbd5
commit
08aab3a879
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue