[PSDK] Satisfy MSVC 2010. Dedicated to Hermès.
[reactos.git] / reactos / 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"KeyLengths"
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_SHA1_ALGORITHM L"SHA1"
65 #define BCRYPT_SHA256_ALGORITHM L"SHA256"
66 #define BCRYPT_SHA384_ALGORITHM L"SHA384"
67 #define BCRYPT_SHA512_ALGORITHM L"SHA512"
68
69 typedef struct _BCRYPT_ALGORITHM_IDENTIFIER
70 {
71 LPWSTR pszName;
72 ULONG dwClass;
73 ULONG dwFlags;
74 } BCRYPT_ALGORITHM_IDENTIFIER;
75
76 typedef PVOID BCRYPT_ALG_HANDLE;
77 typedef PVOID BCRYPT_HANDLE;
78 typedef PVOID BCRYPT_HASH_HANDLE;
79
80 #define BCRYPT_RNG_USE_ENTROPY_IN_BUFFER 0x00000001
81 #define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002
82
83 NTSTATUS WINAPI BCryptCloseAlgorithmProvider(BCRYPT_ALG_HANDLE, ULONG);
84 NTSTATUS WINAPI BCryptCreateHash(BCRYPT_ALG_HANDLE, BCRYPT_HASH_HANDLE *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG);
85 NTSTATUS WINAPI BCryptDestroyHash(BCRYPT_HASH_HANDLE);
86 NTSTATUS WINAPI BCryptEnumAlgorithms(ULONG, ULONG *, BCRYPT_ALGORITHM_IDENTIFIER **, ULONG);
87 NTSTATUS WINAPI BCryptFinishHash(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
88 NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, ULONG);
89 NTSTATUS WINAPI BCryptGetFipsAlgorithmMode(BOOLEAN *);
90 NTSTATUS WINAPI BCryptGetProperty(BCRYPT_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG *, ULONG);
91 NTSTATUS WINAPI BCryptHashData(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
92 NTSTATUS WINAPI BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE *, LPCWSTR, LPCWSTR, ULONG);
93
94 #endif /* __WINE_BCRYPT_H */