ReactOS  0.4.14-dev-50-g13bb5e2
bcrypt.h
Go to the documentation of this file.
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;
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 BCRYPT_OPAQUE_KEY_BLOB L"OpaqueKeyBlob"
62 #define BCRYPT_KEY_DATA_BLOB L"KeyDataBlob"
63 #define BCRYPT_AES_WRAP_KEY_BLOB L"Rfc3565KeyWrapBlob"
64 #define BCRYPT_ECCPUBLIC_BLOB L"ECCPUBLICBLOB"
65 #define BCRYPT_ECCPRIVATE_BLOB L"ECCPRIVATEBLOB"
66 #define BCRYPT_RSAPUBLIC_BLOB L"RSAPUBLICBLOB"
67 #define BCRYPT_RSAPRIVATE_BLOB L"RSAPRIVATEBLOB"
68 
69 #define MS_PRIMITIVE_PROVIDER L"Microsoft Primitive Provider"
70 #define MS_PLATFORM_CRYPTO_PROVIDER L"Microsoft Platform Crypto Provider"
71 
72 #define BCRYPT_MD5_ALGORITHM L"MD5"
73 #define BCRYPT_RNG_ALGORITHM L"RNG"
74 #define BCRYPT_SHA1_ALGORITHM L"SHA1"
75 #define BCRYPT_SHA256_ALGORITHM L"SHA256"
76 #define BCRYPT_SHA384_ALGORITHM L"SHA384"
77 #define BCRYPT_SHA512_ALGORITHM L"SHA512"
78 #define BCRYPT_ECDSA_P256_ALGORITHM L"ECDSA_P256"
79 #define BCRYPT_ECDSA_P384_ALGORITHM L"ECDSA_P384"
80 #define BCRYPT_ECDSA_P521_ALGORITHM L"ECDSA_P521"
81 
82 #define BCRYPT_ECDSA_PUBLIC_P256_MAGIC 0x31534345
83 #define BCRYPT_ECDSA_PRIVATE_P256_MAGIC 0x32534345
84 #define BCRYPT_ECDSA_PUBLIC_P384_MAGIC 0x33534345
85 #define BCRYPT_ECDSA_PRIVATE_P384_MAGIC 0x34534345
86 #define BCRYPT_ECDSA_PUBLIC_P521_MAGIC 0x35534345
87 #define BCRYPT_ECDSA_PRIVATE_P521_MAGIC 0x36534345
88 
90 {
95 
97 {
102 
104 {
109 
111 {
126 
127 typedef struct _BCRYPT_ECCKEY_BLOB
128 {
132 
133 #define BCRYPT_RSAPUBLIC_MAGIC 0x31415352
134 #define BCRYPT_RSAPRIVATE_MAGIC 0x32415352
135 #define BCRYPT_RSAFULLPRIVATE_MAGIC 0x33415352
136 
137 typedef struct _BCRYPT_RSAKEY_BLOB
138 {
146 
148 {
151 
152 #define BCRYPT_PAD_NONE 0x00000001
153 #define BCRYPT_PAD_PKCS1 0x00000002
154 #define BCRYPT_PAD_OAEP 0x00000004
155 #define BCRYPT_PAD_PSS 0x00000008
156 
157 #define BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO_VERSION 1
158 
159 #define BCRYPT_AUTH_MODE_CHAIN_CALLS_FLAG 0x00000001
160 #define BCRYPT_AUTH_MODE_IN_PROGRESS_FLAG 0x00000002
161 
162 #define BCRYPT_KEY_DATA_BLOB_MAGIC 0x4d42444b
163 #define BCRYPT_KEY_DATA_BLOB_VERSION1 1
164 
169 
170 #define BCRYPT_RNG_USE_ENTROPY_IN_BUFFER 0x00000001
171 #define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002
172 #define BCRYPT_ALG_HANDLE_HMAC_FLAG 0x00000008
173 
193 
194 #endif /* __WINE_BCRYPT_H */
* PNTSTATUS
Definition: strlen.c:14
struct _BCRYPT_PKCS1_PADDING_INFO BCRYPT_PKCS1_PADDING_INFO
struct _BCRYPT_KEY_DATA_BLOB_HEADER * PBCRYPT_KEY_DATA_BLOB_HEADER
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
NTSTATUS WINAPI BCryptHashData(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG)
Definition: bcrypt_main.c:1052
#define WINAPI
Definition: bcrypt.h:23
unsigned char * PUCHAR
Definition: retypes.h:3
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI BCryptVerifySignature(BCRYPT_KEY_HANDLE, void *, UCHAR *, ULONG, UCHAR *, ULONG, ULONG)
NTSTATUS WINAPI BCryptImportKeyPair(BCRYPT_ALG_HANDLE, BCRYPT_KEY_HANDLE, LPCWSTR, BCRYPT_KEY_HANDLE *, UCHAR *, ULONG, ULONG)
struct __BCRYPT_KEY_LENGTHS_STRUCT BCRYPT_KEY_LENGTHS_STRUCT
NTSTATUS WINAPI BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE *, LPCWSTR, LPCWSTR, ULONG)
PVOID BCRYPT_HANDLE
Definition: bcrypt.h:167
NTSTATUS WINAPI BCryptEncrypt(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG *, ULONG)
typedef _Return_type_success_(return >=0) LONG NTSTATUS
long LONG
Definition: pedump.c:60
struct _BCRYPT_ECCKEY_BLOB BCRYPT_ECCKEY_BLOB
unsigned char BOOLEAN
struct _BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO * PBCRYPT_AUTHENTICATED_CIPHER_MODE_INFO
NTSTATUS WINAPI BCryptCloseAlgorithmProvider(BCRYPT_ALG_HANDLE, ULONG)
struct _BCRYPT_ALGORITHM_IDENTIFIER BCRYPT_ALGORITHM_IDENTIFIER
NTSTATUS WINAPI BCryptDestroyHash(BCRYPT_HASH_HANDLE)
Definition: bcrypt_main.c:1041
uint64_t ULONGLONG
Definition: typedefs.h:65
NTSTATUS WINAPI BCryptCreateHash(BCRYPT_ALG_HANDLE, BCRYPT_HASH_HANDLE *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG)
Definition: bcrypt_main.c:999
NTSTATUS WINAPI BCryptGetFipsAlgorithmMode(BOOLEAN *)
Definition: bcrypt_main.c:385
unsigned char UCHAR
Definition: xmlstorage.h:181
NTSTATUS WINAPI BCryptDecrypt(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG *, ULONG)
NTSTATUS WINAPI BCryptDestroyKey(BCRYPT_KEY_HANDLE)
NTSTATUS WINAPI BCryptSetProperty(BCRYPT_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG)
struct _BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO
PVOID BCRYPT_KEY_HANDLE
Definition: bcrypt.h:166
NTSTATUS WINAPI BCryptGenerateSymmetricKey(BCRYPT_ALG_HANDLE, BCRYPT_KEY_HANDLE *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG)
struct _BCRYPT_KEY_DATA_BLOB_HEADER BCRYPT_KEY_DATA_BLOB_HEADER
struct _BCRYPT_ECCKEY_BLOB * PBCRYPT_ECCKEY_BLOB
NTSTATUS WINAPI BCryptGetProperty(BCRYPT_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG *, ULONG)
Definition: bcrypt_main.c:972
PVOID BCRYPT_HASH_HANDLE
Definition: bcrypt.h:168
PVOID BCRYPT_ALG_HANDLE
Definition: bcrypt.h:165
NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, ULONG)
Definition: bcrypt_main.c:291
NTSTATUS WINAPI BCryptFinishHash(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG)
Definition: bcrypt_main.c:1071
struct __BCRYPT_KEY_LENGTHS_STRUCT BCRYPT_AUTH_TAG_LENGTHS_STRUCT
NTSTATUS WINAPI BCryptHash(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, PUCHAR, ULONG, PUCHAR, ULONG)
Definition: bcrypt_main.c:1090
unsigned int ULONG
Definition: retypes.h:1
WCHAR * LPWSTR
Definition: xmlstorage.h:184
struct _BCRYPT_RSAKEY_BLOB BCRYPT_RSAKEY_BLOB
NTSTATUS WINAPI BCryptDuplicateHash(BCRYPT_HASH_HANDLE, BCRYPT_HASH_HANDLE *, UCHAR *, ULONG, ULONG)
NTSTATUS WINAPI BCryptEnumAlgorithms(ULONG, ULONG *, BCRYPT_ALGORITHM_IDENTIFIER **, ULONG)
Definition: bcrypt_main.c:244