diff options
author | George Hazan <george.hazan@gmail.com> | 2013-08-15 20:00:29 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-08-15 20:00:29 +0000 |
commit | 623722f7cc4c20d2b7d8df03035801acacda6018 (patch) | |
tree | d4c3686f935c12c9e9274cc3706bef12d9a20d86 /include | |
parent | 8588345b7b8ff89bf90a216dbed2302fcf3ccdbc (diff) |
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
Diffstat (limited to 'include')
-rw-r--r-- | include/delphi/m_core.inc | 2 | ||||
-rw-r--r-- | include/m_core.h | 17 |
2 files changed, 10 insertions, 9 deletions
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
|