summaryrefslogtreecommitdiff
path: root/include/m_core.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/m_core.h')
-rw-r--r--include/m_core.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/include/m_core.h b/include/m_core.h
index e70187306c..c1d031f564 100644
--- a/include/m_core.h
+++ b/include/m_core.h
@@ -341,6 +341,7 @@ MIR_APP_DLL(int) ProtoGetAvatarFileFormat(const TCHAR *ptszFileName);
// sha1 functions
#define MIR_SHA1_HASH_SIZE 20
+#define MIR_SHA_BLOCKSIZE 64
struct mir_sha1_ctx
{
@@ -351,9 +352,9 @@ struct mir_sha1_ctx
};
MIR_CORE_DLL(void) mir_sha1_init(mir_sha1_ctx *ctx);
-MIR_CORE_DLL(void) mir_sha1_append(mir_sha1_ctx *ctx, const BYTE *dataIn, int len);
+MIR_CORE_DLL(void) mir_sha1_append(mir_sha1_ctx *ctx, const BYTE *dataIn, size_t len);
MIR_CORE_DLL(void) mir_sha1_finish(mir_sha1_ctx *ctx, BYTE hashout[MIR_SHA1_HASH_SIZE]);
-MIR_CORE_DLL(void) mir_sha1_hash(BYTE *dataIn, int len, BYTE hashout[MIR_SHA1_HASH_SIZE]);
+MIR_CORE_DLL(void) mir_sha1_hash(BYTE *dataIn, size_t len, BYTE hashout[MIR_SHA1_HASH_SIZE]);
MIR_CORE_DLL(void) mir_hmac_sha1(BYTE hashout[MIR_SHA1_HASH_SIZE], const BYTE *key, size_t keylen, const BYTE *text, size_t textlen);
@@ -366,7 +367,7 @@ struct SHA256_CONTEXT
{
UINT32 h0, h1, h2, h3, h4, h5, h6, h7;
UINT32 nblocks;
- BYTE buf[64];
+ BYTE buf[MIR_SHA_BLOCKSIZE];
int count;
};
@@ -375,6 +376,8 @@ MIR_CORE_DLL(void) mir_sha256_write(SHA256_CONTEXT *ctx, const void *dataIn, siz
MIR_CORE_DLL(void) mir_sha256_final(SHA256_CONTEXT *ctx, BYTE hashout[MIR_SHA256_HASH_SIZE]);
MIR_CORE_DLL(void) mir_sha256_hash(const void *dataIn, size_t len, BYTE hashout[MIR_SHA256_HASH_SIZE]);
+MIR_CORE_DLL(void) mir_hmac_sha256(BYTE hashout[MIR_SHA256_HASH_SIZE], const BYTE *key, size_t keylen, const BYTE *text, size_t textlen);
+
///////////////////////////////////////////////////////////////////////////////
// strings