makefiles: Add support for a generic SOURCES variable.
[wine.git] / dlls / bcrypt / bcrypt_internal.h
bloba75f92a90b94a6af589e1a3c56cae02fe91cfee7
1 /*
2 * Copyright 2016 Michael Müller
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #ifndef __BCRYPT_INTERNAL_H
21 #define __BCRYPT_INTERNAL_H
23 #include <stdarg.h>
25 #include "windef.h"
26 #include "winbase.h"
28 typedef struct
30 ULONG64 len;
31 DWORD h[8];
32 UCHAR buf[64];
33 } SHA256_CTX;
35 void sha256_init(SHA256_CTX *ctx) DECLSPEC_HIDDEN;
36 void sha256_update(SHA256_CTX *ctx, const UCHAR *buffer, ULONG len) DECLSPEC_HIDDEN;
37 void sha256_finalize(SHA256_CTX *ctx, UCHAR *buffer) DECLSPEC_HIDDEN;
39 typedef struct
41 ULONG64 len;
42 ULONG64 h[8];
43 UCHAR buf[128];
44 } SHA512_CTX;
46 void sha512_init(SHA512_CTX *ctx) DECLSPEC_HIDDEN;
47 void sha512_update(SHA512_CTX *ctx, const UCHAR *buffer, ULONG len) DECLSPEC_HIDDEN;
48 void sha512_finalize(SHA512_CTX *ctx, UCHAR *buffer) DECLSPEC_HIDDEN;
50 void sha384_init(SHA512_CTX *ctx) DECLSPEC_HIDDEN;
51 #define sha384_update sha512_update
52 void sha384_finalize(SHA512_CTX *ctx, UCHAR *buffer) DECLSPEC_HIDDEN;
54 typedef struct {
55 unsigned char chksum[16], X[48], buf[16];
56 unsigned long curlen;
57 } MD2_CTX;
59 void md2_init(MD2_CTX *ctx) DECLSPEC_HIDDEN;
60 void md2_update(MD2_CTX *ctx, const unsigned char *buf, ULONG len) DECLSPEC_HIDDEN;
61 void md2_finalize(MD2_CTX *ctx, unsigned char *hash) DECLSPEC_HIDDEN;
63 /* Definitions from advapi32 */
64 typedef struct tagMD4_CTX {
65 unsigned int buf[4];
66 unsigned int i[2];
67 unsigned char in[64];
68 unsigned char digest[16];
69 } MD4_CTX;
71 VOID WINAPI MD4Init(MD4_CTX *ctx);
72 VOID WINAPI MD4Update(MD4_CTX *ctx, const unsigned char *buf, unsigned int len);
73 VOID WINAPI MD4Final(MD4_CTX *ctx);
75 typedef struct
77 unsigned int i[2];
78 unsigned int buf[4];
79 unsigned char in[64];
80 unsigned char digest[16];
81 } MD5_CTX;
83 VOID WINAPI MD5Init(MD5_CTX *ctx);
84 VOID WINAPI MD5Update(MD5_CTX *ctx, const unsigned char *buf, unsigned int len);
85 VOID WINAPI MD5Final(MD5_CTX *ctx);
87 typedef struct
89 ULONG Unknown[6];
90 ULONG State[5];
91 ULONG Count[2];
92 UCHAR Buffer[64];
93 } SHA_CTX;
95 VOID WINAPI A_SHAInit(SHA_CTX *ctx);
96 VOID WINAPI A_SHAUpdate(SHA_CTX *ctx, const UCHAR *buffer, UINT size);
97 VOID WINAPI A_SHAFinal(SHA_CTX *ctx, PULONG result);
99 #endif /* __BCRYPT_INTERNAL_H */