[PSDK] Update bcrypt.h. CORE-12409
[reactos.git] / reactos / sdk / include / psdk / bcrypt.h
1 /*
2 * Copyright (C) 2007 Francois Gouget
3 *
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.
8 *
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.
13 *
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
17 */
18
19 #ifndef __WINE_BCRYPT_H
20 #define __WINE_BCRYPT_H
21
22 #ifndef WINAPI
23 #define WINAPI __stdcall
24 #endif
25
26 #ifndef IN
27 #define IN
28 #endif
29
30 #ifndef OUT
31 #define OUT
32 #endif
33
34 #ifndef OPTIONAL
35 #define OPTIONAL
36 #endif
37
38 #ifndef _NTDEF_
39 typedef _Return_type_success_(return >= 0) LONG NTSTATUS;
40 typedef NTSTATUS *PNTSTATUS;
41 #endif
42
43 #define BCRYPT_ALGORITHM_NAME L"AlgorithmName"
44 #define BCRYPT_AUTH_TAG_LENGTH L"AuthTagLength"
45 #define BCRYPT_BLOCK_LENGTH L"BlockLength"
46 #define BCRYPT_BLOCK_SIZE_LIST L"BlockSizeList"
47 #define BCRYPT_CHAINING_MODE L"ChainingMode"
48 #define BCRYPT_EFFECTIVE_KEY_LENGTH L"EffectiveKeyLength"
49 #define BCRYPT_HASH_BLOCK_LENGTH L"HashBlockLength"
50 #define BCRYPT_HASH_LENGTH L"HashDigestLength"
51 #define BCRYPT_HASH_OID_LIST L"HashOIDList"
52 #define BCRYPT_KEY_LENGTH L"KeyLength"
53 #define BCRYPT_KEY_LENGTHS L"KeyLengths"
54 #define BCRYPT_KEY_OBJECT_LENGTH L"KeyObjectLength"
55 #define BCRYPT_KEY_STRENGTH L"KeyStrength"
56 #define BCRYPT_OBJECT_LENGTH L"ObjectLength"
57 #define BCRYPT_PADDING_SCHEMES L"PaddingSchemes"
58 #define BCRYPT_PROVIDER_HANDLE L"ProviderHandle"
59 #define BCRYPT_SIGNATURE_LENGTH L"SignatureLength"
60
61 #define MS_PRIMITIVE_PROVIDER L"Microsoft Primitive Provider"
62 #define MS_PLATFORM_CRYPTO_PROVIDER L"Microsoft Platform Crypto Provider"
63
64 #define BCRYPT_MD5_ALGORITHM L"MD5"
65 #define BCRYPT_RNG_ALGORITHM L"RNG"
66 #define BCRYPT_SHA1_ALGORITHM L"SHA1"
67 #define BCRYPT_SHA256_ALGORITHM L"SHA256"
68 #define BCRYPT_SHA384_ALGORITHM L"SHA384"
69 #define BCRYPT_SHA512_ALGORITHM L"SHA512"
70
71 typedef struct _BCRYPT_ALGORITHM_IDENTIFIER
72 {
73 LPWSTR pszName;
74 ULONG dwClass;
75 ULONG dwFlags;
76 } BCRYPT_ALGORITHM_IDENTIFIER;
77
78 typedef PVOID BCRYPT_ALG_HANDLE;
79 typedef PVOID BCRYPT_HANDLE;
80 typedef PVOID BCRYPT_HASH_HANDLE;
81
82 #define BCRYPT_RNG_USE_ENTROPY_IN_BUFFER 0x00000001
83 #define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002
84 #define BCRYPT_ALG_HANDLE_HMAC_FLAG 0x00000008
85
86 NTSTATUS WINAPI BCryptCloseAlgorithmProvider(BCRYPT_ALG_HANDLE, ULONG);
87 NTSTATUS WINAPI BCryptCreateHash(BCRYPT_ALG_HANDLE, BCRYPT_HASH_HANDLE *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG);
88 NTSTATUS WINAPI BCryptDestroyHash(BCRYPT_HASH_HANDLE);
89 NTSTATUS WINAPI BCryptEnumAlgorithms(ULONG, ULONG *, BCRYPT_ALGORITHM_IDENTIFIER **, ULONG);
90 NTSTATUS WINAPI BCryptFinishHash(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
91 NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, ULONG);
92 NTSTATUS WINAPI BCryptGetFipsAlgorithmMode(BOOLEAN *);
93 NTSTATUS WINAPI BCryptGetProperty(BCRYPT_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG *, ULONG);
94 NTSTATUS WINAPI BCryptHash(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, PUCHAR, ULONG, PUCHAR, ULONG);
95 NTSTATUS WINAPI BCryptHashData(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
96 NTSTATUS WINAPI BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE *, LPCWSTR, LPCWSTR, ULONG);
97
98 #endif /* __WINE_BCRYPT_H */