From 623722f7cc4c20d2b7d8df03035801acacda6018 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 15 Aug 2013 20:00:29 +0000 Subject: mir_sha1_byte_t => BYTE; mir_sha1_long_t => ULONG; mir_hmac_sha1 went to core git-svn-id: http://svn.miranda-ng.org/main/trunk@5707 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- include/delphi/m_core.inc | 2 ++ include/m_core.h | 17 ++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/delphi/m_core.inc b/include/delphi/m_core.inc index 0435eab92f..7462e63d9a 100644 --- a/include/delphi/m_core.inc +++ b/include/delphi/m_core.inc @@ -593,6 +593,8 @@ procedure mir_sha1_finish(ctx:pmir_sha1_ctx; hashout:SHA1Hash); stdcall; procedure mir_sha1_hash(dataIn:pmir_sha1_byte_t; len:int;hashout:SHA1Hash); stdcall; external CoreDLL name 'mir_sha1_hash'; +procedure mir_hmac_sha1(hashout:SHA1Hash; const key:pmir_sha1_byte_t; keyLen:size_t; const dataIn:pmir_sha1_byte_t; dataLen:size_t); stdcall; + external CoreDLL name 'mir_hmac_sha1'; /////////////////////////////////////////////////////////////////////////////// // strings diff --git a/include/m_core.h b/include/m_core.h index 73937eb366..3fdb81a747 100644 --- a/include/m_core.h +++ b/include/m_core.h @@ -654,22 +654,21 @@ MIR_CORE_DLL(int) ProtoGetAvatarFileFormat(const TCHAR *ptszFileName); /////////////////////////////////////////////////////////////////////////////// // sha1 functions -typedef unsigned char mir_sha1_byte_t; -typedef unsigned long mir_sha1_long_t; - #define MIR_SHA1_HASH_SIZE 20 typedef struct { - mir_sha1_long_t H[5]; - mir_sha1_long_t W[80]; + ULONG H[5]; + ULONG W[80]; int lenW; - mir_sha1_long_t sizeHi, sizeLo; + ULONG sizeHi, sizeLo; } 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, mir_sha1_byte_t *dataIn, int len); -MIR_CORE_DLL(void) mir_sha1_finish(mir_sha1_ctx *ctx, mir_sha1_byte_t hashout[20]); -MIR_CORE_DLL(void) mir_sha1_hash(mir_sha1_byte_t *dataIn, int len, mir_sha1_byte_t hashout[20]); +MIR_CORE_DLL(void) mir_sha1_append(mir_sha1_ctx *ctx, const BYTE *dataIn, int 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_hmac_sha1(BYTE hashout[MIR_SHA1_HASH_SIZE], const BYTE *key, size_t keylen, const BYTE *text, size_t textlen); /////////////////////////////////////////////////////////////////////////////// // strings -- cgit v1.2.3