1 // Licensed under the Apache License, Version 2.0
2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
4 // All files in the project carrying such notice may not be copied, modified, or distributed
5 // except according to those terms.
6 //! Cryptographic Primitive API Prototypes and Definitions
7 use shared::minwindef::{PUCHAR, UCHAR, ULONG, USHORT};
8 use um::winnt::{BOOLEAN, HANDLE, LONG, LPCWSTR, LPWSTR, PVOID, PWSTR, ULONGLONG, VOID};
9 pub type NTSTATUS = LONG;
10 pub type PNTSTATUS = *mut NTSTATUS;
11 #[inline]
BCRYPT_SUCCESS(Status: NTSTATUS) -> bool12 pub fn BCRYPT_SUCCESS(Status: NTSTATUS) -> bool {
13 Status >= 0
14 }
15 pub const BCRYPT_OBJECT_ALIGNMENT: usize = 16;
16 pub const BCRYPT_KDF_HASH: &'static str = "HASH";
17 pub const BCRYPT_KDF_HMAC: &'static str = "HMAC";
18 pub const BCRYPT_KDF_TLS_PRF: &'static str = "TLS_PRF";
19 pub const BCRYPT_KDF_SP80056A_CONCAT: &'static str = "SP800_56A_CONCAT";
20 pub const BCRYPT_KDF_RAW_SECRET: &'static str = "TRUNCATE";
21 pub const KDF_HASH_ALGORITHM: ULONG = 0x0;
22 pub const KDF_SECRET_PREPEND: ULONG = 0x1;
23 pub const KDF_SECRET_APPEND: ULONG = 0x2;
24 pub const KDF_HMAC_KEY: ULONG = 0x3;
25 pub const KDF_TLS_PRF_LABEL: ULONG = 0x4;
26 pub const KDF_TLS_PRF_SEED: ULONG = 0x5;
27 pub const KDF_SECRET_HANDLE: ULONG = 0x6;
28 pub const KDF_TLS_PRF_PROTOCOL: ULONG = 0x7;
29 pub const KDF_ALGORITHMID: ULONG = 0x8;
30 pub const KDF_PARTYUINFO: ULONG = 0x9;
31 pub const KDF_PARTYVINFO: ULONG = 0xA;
32 pub const KDF_SUPPPUBINFO: ULONG = 0xB;
33 pub const KDF_SUPPPRIVINFO: ULONG = 0xC;
34 pub const KDF_LABEL: ULONG = 0xD;
35 pub const KDF_CONTEXT: ULONG = 0xE;
36 pub const KDF_SALT: ULONG = 0xF;
37 pub const KDF_ITERATION_COUNT: ULONG = 0x10;
38 pub const KDF_GENERIC_PARAMETER: ULONG = 0x11;
39 pub const KDF_KEYBITLENGTH: ULONG = 0x12;
40 pub const KDF_USE_SECRET_AS_HMAC_KEY_FLAG: ULONG = 0x1;
41 STRUCT!{struct BCRYPT_KEY_LENGTHS_STRUCT {
42 dwMinLength: ULONG,
43 dwMaxLength: ULONG,
44 dwIncrement: ULONG,
45 }}
46 pub type BCRYPT_AUTH_TAG_LENGTHS_STRUCT = BCRYPT_KEY_LENGTHS_STRUCT;
47 STRUCT!{struct BCRYPT_OID {
48 cbOID: ULONG,
49 pbOID: PUCHAR,
50 }}
51 STRUCT!{struct BCRYPT_OID_LIST {
52 dwOIDCount: ULONG,
53 pOIDs: *mut BCRYPT_OID,
54 }}
55 STRUCT!{struct BCRYPT_PKCS1_PADDING_INFO {
56 pszAlgId: LPCWSTR,
57 }}
58 STRUCT!{struct BCRYPT_PSS_PADDING_INFO {
59 pszAlgId: LPCWSTR,
60 cbSalt: ULONG,
61 }}
62 STRUCT!{struct BCRYPT_OAEP_PADDING_INFO {
63 pszAlgId: LPCWSTR,
64 pbLabel: PUCHAR,
65 cbLabel: ULONG,
66 }}
67 pub const BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO_VERSION: ULONG = 1;
68 pub const BCRYPT_AUTH_MODE_CHAIN_CALLS_FLAG: ULONG = 0x00000001;
69 pub const BCRYPT_AUTH_MODE_IN_PROGRESS_FLAG: ULONG = 0x00000002;
70 STRUCT!{struct BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO {
71 cbSize: ULONG,
72 dwInfoVersion: ULONG,
73 pbNonce: PUCHAR,
74 cbNonce: ULONG,
75 pbAuthData: PUCHAR,
76 cbAuthData: ULONG,
77 pbTag: PUCHAR,
78 cbTag: ULONG,
79 pbMacContext: PUCHAR,
80 cbMacContext: ULONG,
81 cbAAD: ULONG,
82 cbData: ULONGLONG,
83 dwFlags: ULONG,
84 }}
85 pub type PBCRYPT_AUTHENTICATED_CIPHER_MODE_INFO = *mut BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO;
86 pub const BCRYPT_OPAQUE_KEY_BLOB: &'static str = "OpaqueKeyBlob";
87 pub const BCRYPT_KEY_DATA_BLOB: &'static str = "KeyDataBlob";
88 pub const BCRYPT_AES_WRAP_KEY_BLOB: &'static str = "Rfc3565KeyWrapBlob";
89 pub const BCRYPT_OBJECT_LENGTH: &'static str = "ObjectLength";
90 pub const BCRYPT_ALGORITHM_NAME: &'static str = "AlgorithmName";
91 pub const BCRYPT_PROVIDER_HANDLE: &'static str = "ProviderHandle";
92 pub const BCRYPT_CHAINING_MODE: &'static str = "ChainingMode";
93 pub const BCRYPT_BLOCK_LENGTH: &'static str = "BlockLength";
94 pub const BCRYPT_KEY_LENGTH: &'static str = "KeyLength";
95 pub const BCRYPT_KEY_OBJECT_LENGTH: &'static str = "KeyObjectLength";
96 pub const BCRYPT_KEY_STRENGTH: &'static str = "KeyStrength";
97 pub const BCRYPT_KEY_LENGTHS: &'static str = "KeyLengths";
98 pub const BCRYPT_BLOCK_SIZE_LIST: &'static str = "BlockSizeList";
99 pub const BCRYPT_EFFECTIVE_KEY_LENGTH: &'static str = "EffectiveKeyLength";
100 pub const BCRYPT_HASH_LENGTH: &'static str = "HashDigestLength";
101 pub const BCRYPT_HASH_OID_LIST: &'static str = "HashOIDList";
102 pub const BCRYPT_PADDING_SCHEMES: &'static str = "PaddingSchemes";
103 pub const BCRYPT_SIGNATURE_LENGTH: &'static str = "SignatureLength";
104 pub const BCRYPT_HASH_BLOCK_LENGTH: &'static str = "HashBlockLength";
105 pub const BCRYPT_AUTH_TAG_LENGTH: &'static str = "AuthTagLength";
106 pub const BCRYPT_PRIMITIVE_TYPE: &'static str = "PrimitiveType";
107 pub const BCRYPT_IS_KEYED_HASH: &'static str = "IsKeyedHash";
108 pub const BCRYPT_IS_REUSABLE_HASH: &'static str = "IsReusableHash";
109 pub const BCRYPT_MESSAGE_BLOCK_LENGTH: &'static str = "MessageBlockLength";
110 pub const BCRYPT_PUBLIC_KEY_LENGTH: &'static str = "PublicKeyLength";
111 pub const BCRYPT_PCP_PLATFORM_TYPE_PROPERTY: &'static str = "PCP_PLATFORM_TYPE";
112 pub const BCRYPT_PCP_PROVIDER_VERSION_PROPERTY: &'static str = "PCP_PROVIDER_VERSION";
113 pub const BCRYPT_MULTI_OBJECT_LENGTH: &'static str = "MultiObjectLength";
114 pub const BCRYPT_INITIALIZATION_VECTOR: &'static str = "IV";
115 pub const BCRYPT_CHAIN_MODE_NA: &'static str = "ChainingModeN/A";
116 pub const BCRYPT_CHAIN_MODE_CBC: &'static str = "ChainingModeCBC";
117 pub const BCRYPT_CHAIN_MODE_ECB: &'static str = "ChainingModeECB";
118 pub const BCRYPT_CHAIN_MODE_CFB: &'static str = "ChainingModeCFB";
119 pub const BCRYPT_CHAIN_MODE_CCM: &'static str = "ChainingModeCCM";
120 pub const BCRYPT_CHAIN_MODE_GCM: &'static str = "ChainingModeGCM";
121 pub const BCRYPT_PROV_DISPATCH: ULONG = 0x00000001;
122 pub const BCRYPT_BLOCK_PADDING: ULONG = 0x00000001;
123 pub const BCRYPT_PAD_NONE: ULONG = 0x00000001;
124 pub const BCRYPT_PAD_PKCS1: ULONG = 0x00000002;
125 pub const BCRYPT_PAD_OAEP: ULONG = 0x00000004;
126 pub const BCRYPT_PAD_PSS: ULONG = 0x00000008;
127 pub const BCRYPT_PAD_PKCS1_OPTIONAL_HASH_OID: ULONG = 0x00000010;
128 pub const BCRYPTBUFFER_VERSION: ULONG = 0;
129 STRUCT!{struct BCryptBuffer {
130 cbBuffer: ULONG,
131 BufferType: ULONG,
132 pvBuffer: PVOID,
133 }}
134 pub type PBCryptBuffer = *mut BCryptBuffer;
135 STRUCT!{struct BCryptBufferDesc {
136 ulVersion: ULONG,
137 cBuffers: ULONG,
138 pBuffers: PBCryptBuffer,
139 }}
140 pub type PBCryptBufferDesc = *mut BCryptBufferDesc;
141 pub type BCRYPT_HANDLE = PVOID;
142 pub type BCRYPT_ALG_HANDLE = PVOID;
143 pub type BCRYPT_KEY_HANDLE = PVOID;
144 pub type BCRYPT_HASH_HANDLE = PVOID;
145 pub type BCRYPT_SECRET_HANDLE = PVOID;
146 pub const BCRYPT_PUBLIC_KEY_BLOB: &'static str = "PUBLICBLOB";
147 pub const BCRYPT_PRIVATE_KEY_BLOB: &'static str = "PRIVATEBLOB";
148 STRUCT!{struct BCRYPT_KEY_BLOB {
149 Magic: ULONG,
150 }}
151 pub const BCRYPT_RSAPUBLIC_BLOB: &'static str = "RSAPUBLICBLOB";
152 pub const BCRYPT_RSAPRIVATE_BLOB: &'static str = "RSAPRIVATEBLOB";
153 pub const LEGACY_RSAPUBLIC_BLOB: &'static str = "CAPIPUBLICBLOB";
154 pub const LEGACY_RSAPRIVATE_BLOB: &'static str = "CAPIPRIVATEBLOB";
155 pub const BCRYPT_RSAPUBLIC_MAGIC: ULONG = 0x31415352;
156 pub const BCRYPT_RSAPRIVATE_MAGIC: ULONG = 0x32415352;
157 STRUCT!{struct BCRYPT_RSAKEY_BLOB {
158 Magic: ULONG,
159 BitLength: ULONG,
160 cbPublicExp: ULONG,
161 cbModulus: ULONG,
162 cbPrime1: ULONG,
163 cbPrime2: ULONG,
164 }}
165 pub const BCRYPT_RSAFULLPRIVATE_BLOB: &'static str = "RSAFULLPRIVATEBLOB";
166 pub const BCRYPT_RSAFULLPRIVATE_MAGIC: ULONG = 0x33415352;
167 pub const BCRYPT_GLOBAL_PARAMETERS: &'static str = "SecretAgreementParam";
168 pub const BCRYPT_PRIVATE_KEY: &'static str = "PrivKeyVal";
169 pub const BCRYPT_ECCPUBLIC_BLOB: &'static str = "ECCPUBLICBLOB";
170 pub const BCRYPT_ECCPRIVATE_BLOB: &'static str = "ECCPRIVATEBLOB";
171 pub const BCRYPT_ECCFULLPUBLIC_BLOB: &'static str = "ECCFULLPUBLICBLOB";
172 pub const BCRYPT_ECCFULLPRIVATE_BLOB: &'static str = "ECCFULLPRIVATEBLOB";
173 pub const SSL_ECCPUBLIC_BLOB: &'static str = "SSLECCPUBLICBLOB";
174 pub const BCRYPT_ECDH_PUBLIC_P256_MAGIC: ULONG = 0x314B4345;
175 pub const BCRYPT_ECDH_PRIVATE_P256_MAGIC: ULONG = 0x324B4345;
176 pub const BCRYPT_ECDH_PUBLIC_P384_MAGIC: ULONG = 0x334B4345;
177 pub const BCRYPT_ECDH_PRIVATE_P384_MAGIC: ULONG = 0x344B4345;
178 pub const BCRYPT_ECDH_PUBLIC_P521_MAGIC: ULONG = 0x354B4345;
179 pub const BCRYPT_ECDH_PRIVATE_P521_MAGIC: ULONG = 0x364B4345;
180 pub const BCRYPT_ECDH_PUBLIC_GENERIC_MAGIC: ULONG = 0x504B4345;
181 pub const BCRYPT_ECDH_PRIVATE_GENERIC_MAGIC: ULONG = 0x564B4345;
182 pub const BCRYPT_ECDSA_PUBLIC_P256_MAGIC: ULONG = 0x31534345;
183 pub const BCRYPT_ECDSA_PRIVATE_P256_MAGIC: ULONG = 0x32534345;
184 pub const BCRYPT_ECDSA_PUBLIC_P384_MAGIC: ULONG = 0x33534345;
185 pub const BCRYPT_ECDSA_PRIVATE_P384_MAGIC: ULONG = 0x34534345;
186 pub const BCRYPT_ECDSA_PUBLIC_P521_MAGIC: ULONG = 0x35534345;
187 pub const BCRYPT_ECDSA_PRIVATE_P521_MAGIC: ULONG = 0x36534345;
188 pub const BCRYPT_ECDSA_PUBLIC_GENERIC_MAGIC: ULONG = 0x50444345;
189 pub const BCRYPT_ECDSA_PRIVATE_GENERIC_MAGIC: ULONG = 0x56444345;
190 STRUCT!{struct BCRYPT_ECCKEY_BLOB {
191 dwMagic: ULONG,
192 cbKey: ULONG,
193 }}
194 pub type PBCRYPT_ECCKEY_BLOB = *mut BCRYPT_ECCKEY_BLOB;
195 STRUCT!{struct SSL_ECCKEY_BLOB {
196 dwCurveType: ULONG,
197 cbKey: ULONG,
198 }}
199 pub type PSSL_ECCKEY_BLOB = *mut SSL_ECCKEY_BLOB;
200 pub const BCRYPT_ECC_FULLKEY_BLOB_V1: ULONG = 0x1;
201 ENUM!{enum ECC_CURVE_TYPE_ENUM {
202 BCRYPT_ECC_PRIME_SHORT_WEIERSTRASS_CURVE = 0x1,
203 BCRYPT_ECC_PRIME_TWISTED_EDWARDS_CURVE = 0x2,
204 BCRYPT_ECC_PRIME_MONTGOMERY_CURVE = 0x3,
205 }}
206 ENUM!{enum ECC_CURVE_ALG_ID_ENUM {
207 BCRYPT_NO_CURVE_GENERATION_ALG_ID = 0x0,
208 }}
209 STRUCT!{struct BCRYPT_ECCFULLKEY_BLOB {
210 dwMagic: ULONG,
211 dwVersion: ULONG,
212 dwCurveType: ECC_CURVE_TYPE_ENUM,
213 dwCurveGenerationAlgId: ECC_CURVE_ALG_ID_ENUM,
214 cbFieldLength: ULONG,
215 cbSubgroupOrder: ULONG,
216 cbCofactor: ULONG,
217 cbSeed: ULONG,
218 }}
219 pub type PBCRYPT_ECCFULLKEY_BLOB = *mut BCRYPT_ECCFULLKEY_BLOB;
220 pub const BCRYPT_DH_PUBLIC_BLOB: &'static str = "DHPUBLICBLOB";
221 pub const BCRYPT_DH_PRIVATE_BLOB: &'static str = "DHPRIVATEBLOB";
222 pub const LEGACY_DH_PUBLIC_BLOB: &'static str = "CAPIDHPUBLICBLOB";
223 pub const LEGACY_DH_PRIVATE_BLOB: &'static str = "CAPIDHPRIVATEBLOB";
224 pub const BCRYPT_DH_PUBLIC_MAGIC: ULONG = 0x42504844;
225 pub const BCRYPT_DH_PRIVATE_MAGIC: ULONG = 0x56504844;
226 STRUCT!{struct BCRYPT_DH_KEY_BLOB {
227 dwMagic: ULONG,
228 cbKey: ULONG,
229 }}
230 pub type PBCRYPT_DH_KEY_BLOB = *mut BCRYPT_DH_KEY_BLOB;
231 pub const BCRYPT_DH_PARAMETERS: &'static str = "DHParameters";
232 pub const BCRYPT_DH_PARAMETERS_MAGIC: ULONG = 0x4d504844;
233 STRUCT!{struct BCRYPT_DH_PARAMETER_HEADER {
234 cbLength: ULONG,
235 dwMagic: ULONG,
236 cbKeyLength: ULONG,
237 }}
238 pub const BCRYPT_DSA_PUBLIC_BLOB: &'static str = "DSAPUBLICBLOB";
239 pub const BCRYPT_DSA_PRIVATE_BLOB: &'static str = "DSAPRIVATEBLOB";
240 pub const LEGACY_DSA_PUBLIC_BLOB: &'static str = "CAPIDSAPUBLICBLOB";
241 pub const LEGACY_DSA_PRIVATE_BLOB: &'static str = "CAPIDSAPRIVATEBLOB";
242 pub const LEGACY_DSA_V2_PUBLIC_BLOB: &'static str = "V2CAPIDSAPUBLICBLOB";
243 pub const LEGACY_DSA_V2_PRIVATE_BLOB: &'static str = "V2CAPIDSAPRIVATEBLOB";
244 pub const BCRYPT_DSA_PUBLIC_MAGIC: ULONG = 0x42505344;
245 pub const BCRYPT_DSA_PRIVATE_MAGIC: ULONG = 0x56505344;
246 pub const BCRYPT_DSA_PUBLIC_MAGIC_V2: ULONG = 0x32425044;
247 pub const BCRYPT_DSA_PRIVATE_MAGIC_V2: ULONG = 0x32565044;
248 STRUCT!{struct BCRYPT_DSA_KEY_BLOB {
249 dwMagic: ULONG,
250 cbKey: ULONG,
251 Count: [UCHAR; 4],
252 Seed: [UCHAR; 20],
253 q: [UCHAR; 20],
254 }}
255 pub type PBCRYPT_DSA_KEY_BLOB = *mut BCRYPT_DSA_KEY_BLOB;
256 ENUM!{enum HASHALGORITHM_ENUM {
257 DSA_HASH_ALGORITHM_SHA1,
258 DSA_HASH_ALGORITHM_SHA256,
259 DSA_HASH_ALGORITHM_SHA512,
260 }}
261 ENUM!{enum DSAFIPSVERSION_ENUM {
262 DSA_FIPS186_2,
263 DSA_FIPS186_3,
264 }}
265 STRUCT!{struct BCRYPT_DSA_KEY_BLOB_V2 {
266 dwMagic: ULONG,
267 cbKey: ULONG,
268 hashAlgorithm: HASHALGORITHM_ENUM,
269 standardVersion: DSAFIPSVERSION_ENUM,
270 cbSeedLength: ULONG,
271 cbGroupSize: ULONG,
272 Count: [UCHAR; 4],
273 }}
274 pub type PBCRYPT_DSA_KEY_BLOB_V2 = *mut BCRYPT_DSA_KEY_BLOB_V2;
275 STRUCT!{struct BCRYPT_KEY_DATA_BLOB_HEADER {
276 dwMagic: ULONG,
277 dwVersion: ULONG,
278 cbKeyData: ULONG,
279 }}
280 pub type PBCRYPT_KEY_DATA_BLOB_HEADER = *mut BCRYPT_KEY_DATA_BLOB_HEADER;
281 pub const BCRYPT_KEY_DATA_BLOB_MAGIC: ULONG = 0x4d42444b;
282 pub const BCRYPT_KEY_DATA_BLOB_VERSION1: ULONG = 0x1;
283 pub const BCRYPT_DSA_PARAMETERS: &'static str = "DSAParameters";
284 pub const BCRYPT_DSA_PARAMETERS_MAGIC: ULONG = 0x4d505344;
285 pub const BCRYPT_DSA_PARAMETERS_MAGIC_V2: ULONG = 0x324d5044;
286 STRUCT!{struct BCRYPT_DSA_PARAMETER_HEADER {
287 cbLength: ULONG,
288 dwMagic: ULONG,
289 cbKeyLength: ULONG,
290 Count: [UCHAR; 4],
291 Seed: [UCHAR; 20],
292 q: [UCHAR; 20],
293 }}
294 STRUCT!{struct BCRYPT_DSA_PARAMETER_HEADER_V2 {
295 cbLength: ULONG,
296 dwMagic: ULONG,
297 cbKeyLength: ULONG,
298 hashAlgorithm: HASHALGORITHM_ENUM,
299 standardVersion: DSAFIPSVERSION_ENUM,
300 cbSeedLength: ULONG,
301 cbGroupSize: ULONG,
302 Count: [UCHAR; 4],
303 }}
304 pub const BCRYPT_ECC_PARAMETERS: &'static str = "ECCParameters";
305 pub const BCRYPT_ECC_CURVE_NAME: &'static str = "ECCCurveName";
306 pub const BCRYPT_ECC_CURVE_NAME_LIST: &'static str = "ECCCurveNameList";
307 pub const BCRYPT_ECC_PARAMETERS_MAGIC: ULONG = 0x50434345;
308 STRUCT!{struct BCRYPT_ECC_CURVE_NAMES {
309 dwEccCurveNames: ULONG,
310 pEccCurveNames: LPWSTR,
311 }}
312 pub const BCRYPT_ECC_CURVE_BRAINPOOLP160R1: &'static str = "brainpoolP160r1";
313 pub const BCRYPT_ECC_CURVE_BRAINPOOLP160T1: &'static str = "brainpoolP160t1";
314 pub const BCRYPT_ECC_CURVE_BRAINPOOLP192R1: &'static str = "brainpoolP192r1";
315 pub const BCRYPT_ECC_CURVE_BRAINPOOLP192T1: &'static str = "brainpoolP192t1";
316 pub const BCRYPT_ECC_CURVE_BRAINPOOLP224R1: &'static str = "brainpoolP224r1";
317 pub const BCRYPT_ECC_CURVE_BRAINPOOLP224T1: &'static str = "brainpoolP224t1";
318 pub const BCRYPT_ECC_CURVE_BRAINPOOLP256R1: &'static str = "brainpoolP256r1";
319 pub const BCRYPT_ECC_CURVE_BRAINPOOLP256T1: &'static str = "brainpoolP256t1";
320 pub const BCRYPT_ECC_CURVE_BRAINPOOLP320R1: &'static str = "brainpoolP320r1";
321 pub const BCRYPT_ECC_CURVE_BRAINPOOLP320T1: &'static str = "brainpoolP320t1";
322 pub const BCRYPT_ECC_CURVE_BRAINPOOLP384R1: &'static str = "brainpoolP384r1";
323 pub const BCRYPT_ECC_CURVE_BRAINPOOLP384T1: &'static str = "brainpoolP384t1";
324 pub const BCRYPT_ECC_CURVE_BRAINPOOLP512R1: &'static str = "brainpoolP512r1";
325 pub const BCRYPT_ECC_CURVE_BRAINPOOLP512T1: &'static str = "brainpoolP512t1";
326 pub const BCRYPT_ECC_CURVE_25519: &'static str = "curve25519";
327 pub const BCRYPT_ECC_CURVE_EC192WAPI: &'static str = "ec192wapi";
328 pub const BCRYPT_ECC_CURVE_NISTP192: &'static str = "nistP192";
329 pub const BCRYPT_ECC_CURVE_NISTP224: &'static str = "nistP224";
330 pub const BCRYPT_ECC_CURVE_NISTP256: &'static str = "nistP256";
331 pub const BCRYPT_ECC_CURVE_NISTP384: &'static str = "nistP384";
332 pub const BCRYPT_ECC_CURVE_NISTP521: &'static str = "nistP521";
333 pub const BCRYPT_ECC_CURVE_NUMSP256T1: &'static str = "numsP256t1";
334 pub const BCRYPT_ECC_CURVE_NUMSP384T1: &'static str = "numsP384t1";
335 pub const BCRYPT_ECC_CURVE_NUMSP512T1: &'static str = "numsP512t1";
336 pub const BCRYPT_ECC_CURVE_SECP160K1: &'static str = "secP160k1";
337 pub const BCRYPT_ECC_CURVE_SECP160R1: &'static str = "secP160r1";
338 pub const BCRYPT_ECC_CURVE_SECP160R2: &'static str = "secP160r2";
339 pub const BCRYPT_ECC_CURVE_SECP192K1: &'static str = "secP192k1";
340 pub const BCRYPT_ECC_CURVE_SECP192R1: &'static str = "secP192r1";
341 pub const BCRYPT_ECC_CURVE_SECP224K1: &'static str = "secP224k1";
342 pub const BCRYPT_ECC_CURVE_SECP224R1: &'static str = "secP224r1";
343 pub const BCRYPT_ECC_CURVE_SECP256K1: &'static str = "secP256k1";
344 pub const BCRYPT_ECC_CURVE_SECP256R1: &'static str = "secP256r1";
345 pub const BCRYPT_ECC_CURVE_SECP384R1: &'static str = "secP384r1";
346 pub const BCRYPT_ECC_CURVE_SECP521R1: &'static str = "secP521r1";
347 pub const BCRYPT_ECC_CURVE_WTLS7: &'static str = "wtls7";
348 pub const BCRYPT_ECC_CURVE_WTLS9: &'static str = "wtls9";
349 pub const BCRYPT_ECC_CURVE_WTLS12: &'static str = "wtls12";
350 pub const BCRYPT_ECC_CURVE_X962P192V1: &'static str = "x962P192v1";
351 pub const BCRYPT_ECC_CURVE_X962P192V2: &'static str = "x962P192v2";
352 pub const BCRYPT_ECC_CURVE_X962P192V3: &'static str = "x962P192v3";
353 pub const BCRYPT_ECC_CURVE_X962P239V1: &'static str = "x962P239v1";
354 pub const BCRYPT_ECC_CURVE_X962P239V2: &'static str = "x962P239v2";
355 pub const BCRYPT_ECC_CURVE_X962P239V3: &'static str = "x962P239v3";
356 pub const BCRYPT_ECC_CURVE_X962P256V1: &'static str = "x962P256v1";
357 ENUM!{enum BCRYPT_HASH_OPERATION_TYPE {
358 BCRYPT_HASH_OPERATION_HASH_DATA = 1,
359 BCRYPT_HASH_OPERATION_FINISH_HASH = 2,
360 }}
361 STRUCT!{struct BCRYPT_MULTI_HASH_OPERATION {
362 iHash: ULONG,
363 hashOperation: BCRYPT_HASH_OPERATION_TYPE,
364 pbBuffer: PUCHAR,
365 cbBuffer: ULONG,
366 }}
367 ENUM!{enum BCRYPT_MULTI_OPERATION_TYPE {
368 BCRYPT_OPERATION_TYPE_HASH = 1,
369 }}
370 STRUCT!{struct BCRYPT_MULTI_OBJECT_LENGTH_STRUCT {
371 cbPerObject: ULONG,
372 cbPerElement: ULONG,
373 }}
374 pub const MS_PRIMITIVE_PROVIDER: &'static str = "Microsoft Primitive Provider";
375 pub const MS_PLATFORM_CRYPTO_PROVIDER: &'static str = "Microsoft Platform Crypto Provider";
376 pub const BCRYPT_RSA_ALGORITHM: &'static str = "RSA";
377 pub const BCRYPT_RSA_SIGN_ALGORITHM: &'static str = "RSA_SIGN";
378 pub const BCRYPT_DH_ALGORITHM: &'static str = "DH";
379 pub const BCRYPT_DSA_ALGORITHM: &'static str = "DSA";
380 pub const BCRYPT_RC2_ALGORITHM: &'static str = "RC2";
381 pub const BCRYPT_RC4_ALGORITHM: &'static str = "RC4";
382 pub const BCRYPT_AES_ALGORITHM: &'static str = "AES";
383 pub const BCRYPT_DES_ALGORITHM: &'static str = "DES";
384 pub const BCRYPT_DESX_ALGORITHM: &'static str = "DESX";
385 pub const BCRYPT_3DES_ALGORITHM: &'static str = "3DES";
386 pub const BCRYPT_3DES_112_ALGORITHM: &'static str = "3DES_112";
387 pub const BCRYPT_MD2_ALGORITHM: &'static str = "MD2";
388 pub const BCRYPT_MD4_ALGORITHM: &'static str = "MD4";
389 pub const BCRYPT_MD5_ALGORITHM: &'static str = "MD5";
390 pub const BCRYPT_SHA1_ALGORITHM: &'static str = "SHA1";
391 pub const BCRYPT_SHA256_ALGORITHM: &'static str = "SHA256";
392 pub const BCRYPT_SHA384_ALGORITHM: &'static str = "SHA384";
393 pub const BCRYPT_SHA512_ALGORITHM: &'static str = "SHA512";
394 pub const BCRYPT_AES_GMAC_ALGORITHM: &'static str = "AES-GMAC";
395 pub const BCRYPT_AES_CMAC_ALGORITHM: &'static str = "AES-CMAC";
396 pub const BCRYPT_ECDSA_P256_ALGORITHM: &'static str = "ECDSA_P256";
397 pub const BCRYPT_ECDSA_P384_ALGORITHM: &'static str = "ECDSA_P384";
398 pub const BCRYPT_ECDSA_P521_ALGORITHM: &'static str = "ECDSA_P521";
399 pub const BCRYPT_ECDH_P256_ALGORITHM: &'static str = "ECDH_P256";
400 pub const BCRYPT_ECDH_P384_ALGORITHM: &'static str = "ECDH_P384";
401 pub const BCRYPT_ECDH_P521_ALGORITHM: &'static str = "ECDH_P521";
402 pub const BCRYPT_RNG_ALGORITHM: &'static str = "RNG";
403 pub const BCRYPT_RNG_FIPS186_DSA_ALGORITHM: &'static str = "FIPS186DSARNG";
404 pub const BCRYPT_RNG_DUAL_EC_ALGORITHM: &'static str = "DUALECRNG";
405 pub const BCRYPT_SP800108_CTR_HMAC_ALGORITHM: &'static str = "SP800_108_CTR_HMAC";
406 pub const BCRYPT_SP80056A_CONCAT_ALGORITHM: &'static str = "SP800_56A_CONCAT";
407 pub const BCRYPT_PBKDF2_ALGORITHM: &'static str = "PBKDF2";
408 pub const BCRYPT_CAPI_KDF_ALGORITHM: &'static str = "CAPI_KDF";
409 pub const BCRYPT_TLS1_1_KDF_ALGORITHM: &'static str = "TLS1_1_KDF";
410 pub const BCRYPT_TLS1_2_KDF_ALGORITHM: &'static str = "TLS1_2_KDF";
411 pub const BCRYPT_ECDSA_ALGORITHM: &'static str = "ECDSA";
412 pub const BCRYPT_ECDH_ALGORITHM: &'static str = "ECDH";
413 pub const BCRYPT_XTS_AES_ALGORITHM: &'static str = "XTS-AES";
414 pub const BCRYPT_CIPHER_INTERFACE: ULONG = 0x00000001;
415 pub const BCRYPT_HASH_INTERFACE: ULONG = 0x00000002;
416 pub const BCRYPT_ASYMMETRIC_ENCRYPTION_INTERFACE: ULONG = 0x00000003;
417 pub const BCRYPT_SECRET_AGREEMENT_INTERFACE: ULONG = 0x00000004;
418 pub const BCRYPT_SIGNATURE_INTERFACE: ULONG = 0x00000005;
419 pub const BCRYPT_RNG_INTERFACE: ULONG = 0x00000006;
420 pub const BCRYPT_KEY_DERIVATION_INTERFACE: ULONG = 0x00000007;
421 pub const BCRYPT_MD2_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000001 as BCRYPT_ALG_HANDLE;
422 pub const BCRYPT_MD4_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000011 as BCRYPT_ALG_HANDLE;
423 pub const BCRYPT_MD5_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000021 as BCRYPT_ALG_HANDLE;
424 pub const BCRYPT_SHA1_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000031 as BCRYPT_ALG_HANDLE;
425 pub const BCRYPT_SHA256_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000041 as BCRYPT_ALG_HANDLE;
426 pub const BCRYPT_SHA384_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000051 as BCRYPT_ALG_HANDLE;
427 pub const BCRYPT_SHA512_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000061 as BCRYPT_ALG_HANDLE;
428 pub const BCRYPT_RC4_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000071 as BCRYPT_ALG_HANDLE;
429 pub const BCRYPT_RNG_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000081 as BCRYPT_ALG_HANDLE;
430 pub const BCRYPT_HMAC_MD5_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000091 as BCRYPT_ALG_HANDLE;
431 pub const BCRYPT_HMAC_SHA1_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000000a1 as BCRYPT_ALG_HANDLE;
432 pub const BCRYPT_HMAC_SHA256_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000000b1 as BCRYPT_ALG_HANDLE;
433 pub const BCRYPT_HMAC_SHA384_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000000c1 as BCRYPT_ALG_HANDLE;
434 pub const BCRYPT_HMAC_SHA512_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000000d1 as BCRYPT_ALG_HANDLE;
435 pub const BCRYPT_RSA_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000000e1 as BCRYPT_ALG_HANDLE;
436 pub const BCRYPT_ECDSA_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000000f1 as BCRYPT_ALG_HANDLE;
437 pub const BCRYPT_AES_CMAC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000101 as BCRYPT_ALG_HANDLE;
438 pub const BCRYPT_AES_GMAC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000111 as BCRYPT_ALG_HANDLE;
439 pub const BCRYPT_HMAC_MD2_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000121 as BCRYPT_ALG_HANDLE;
440 pub const BCRYPT_HMAC_MD4_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000131 as BCRYPT_ALG_HANDLE;
441 pub const BCRYPT_3DES_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000141 as BCRYPT_ALG_HANDLE;
442 pub const BCRYPT_3DES_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000151 as BCRYPT_ALG_HANDLE;
443 pub const BCRYPT_3DES_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000161 as BCRYPT_ALG_HANDLE;
444 pub const BCRYPT_3DES_112_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000171 as BCRYPT_ALG_HANDLE;
445 pub const BCRYPT_3DES_112_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000181 as BCRYPT_ALG_HANDLE;
446 pub const BCRYPT_3DES_112_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000191 as BCRYPT_ALG_HANDLE;
447 pub const BCRYPT_AES_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000001a1 as BCRYPT_ALG_HANDLE;
448 pub const BCRYPT_AES_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000001b1 as BCRYPT_ALG_HANDLE;
449 pub const BCRYPT_AES_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000001c1 as BCRYPT_ALG_HANDLE;
450 pub const BCRYPT_AES_CCM_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000001d1 as BCRYPT_ALG_HANDLE;
451 pub const BCRYPT_AES_GCM_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000001e1 as BCRYPT_ALG_HANDLE;
452 pub const BCRYPT_DES_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000001f1 as BCRYPT_ALG_HANDLE;
453 pub const BCRYPT_DES_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000201 as BCRYPT_ALG_HANDLE;
454 pub const BCRYPT_DES_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000211 as BCRYPT_ALG_HANDLE;
455 pub const BCRYPT_DESX_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000221 as BCRYPT_ALG_HANDLE;
456 pub const BCRYPT_DESX_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000231 as BCRYPT_ALG_HANDLE;
457 pub const BCRYPT_DESX_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000241 as BCRYPT_ALG_HANDLE;
458 pub const BCRYPT_RC2_CBC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000251 as BCRYPT_ALG_HANDLE;
459 pub const BCRYPT_RC2_ECB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000261 as BCRYPT_ALG_HANDLE;
460 pub const BCRYPT_RC2_CFB_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000271 as BCRYPT_ALG_HANDLE;
461 pub const BCRYPT_DH_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000281 as BCRYPT_ALG_HANDLE;
462 pub const BCRYPT_ECDH_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000291 as BCRYPT_ALG_HANDLE;
463 pub const BCRYPT_ECDH_P256_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000002a1 as BCRYPT_ALG_HANDLE;
464 pub const BCRYPT_ECDH_P384_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000002b1 as BCRYPT_ALG_HANDLE;
465 pub const BCRYPT_ECDH_P521_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000002c1 as BCRYPT_ALG_HANDLE;
466 pub const BCRYPT_DSA_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000002d1 as BCRYPT_ALG_HANDLE;
467 pub const BCRYPT_ECDSA_P256_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000002e1 as BCRYPT_ALG_HANDLE;
468 pub const BCRYPT_ECDSA_P384_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x000002f1 as BCRYPT_ALG_HANDLE;
469 pub const BCRYPT_ECDSA_P521_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000301 as BCRYPT_ALG_HANDLE;
470 pub const BCRYPT_RSA_SIGN_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000311 as BCRYPT_ALG_HANDLE;
471 pub const BCRYPT_CAPI_KDF_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000321 as BCRYPT_ALG_HANDLE;
472 pub const BCRYPT_PBKDF2_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000331 as BCRYPT_ALG_HANDLE;
473 pub const BCRYPT_SP800108_CTR_HMAC_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000341 as BCRYPT_ALG_HANDLE;
474 pub const BCRYPT_SP80056A_CONCAT_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000351 as BCRYPT_ALG_HANDLE;
475 pub const BCRYPT_TLS1_1_KDF_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000361 as BCRYPT_ALG_HANDLE;
476 pub const BCRYPT_TLS1_2_KDF_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000371 as BCRYPT_ALG_HANDLE;
477 pub const BCRYPT_XTS_AES_ALG_HANDLE: BCRYPT_ALG_HANDLE = 0x00000381 as BCRYPT_ALG_HANDLE;
478 pub const BCRYPT_ALG_HANDLE_HMAC_FLAG: ULONG = 0x00000008;
479 pub const BCRYPT_CAPI_AES_FLAG: ULONG = 0x00000010;
480 pub const BCRYPT_HASH_REUSABLE_FLAG: ULONG = 0x00000020;
481 pub const BCRYPT_BUFFERS_LOCKED_FLAG: ULONG = 0x00000040;
482 pub const BCRYPT_EXTENDED_KEYSIZE: ULONG = 0x00000080;
483 pub const BCRYPT_ENABLE_INCOMPATIBLE_FIPS_CHECKS: ULONG = 0x00000100;
484 extern "system" {
BCryptOpenAlgorithmProvider( phAlgorithm: *mut BCRYPT_ALG_HANDLE, pszAlgId: LPCWSTR, pszImplementation: LPCWSTR, dwFlags: ULONG, ) -> NTSTATUS485 pub fn BCryptOpenAlgorithmProvider(
486 phAlgorithm: *mut BCRYPT_ALG_HANDLE,
487 pszAlgId: LPCWSTR,
488 pszImplementation: LPCWSTR,
489 dwFlags: ULONG,
490 ) -> NTSTATUS;
491 }
492 pub const BCRYPT_CIPHER_OPERATION: ULONG = 0x00000001;
493 pub const BCRYPT_HASH_OPERATION: ULONG = 0x00000002;
494 pub const BCRYPT_ASYMMETRIC_ENCRYPTION_OPERATION: ULONG = 0x00000004;
495 pub const BCRYPT_SECRET_AGREEMENT_OPERATION: ULONG = 0x00000008;
496 pub const BCRYPT_SIGNATURE_OPERATION: ULONG = 0x00000010;
497 pub const BCRYPT_RNG_OPERATION: ULONG = 0x00000020;
498 pub const BCRYPT_KEY_DERIVATION_OPERATION: ULONG = 0x00000040;
499 STRUCT!{struct BCRYPT_ALGORITHM_IDENTIFIER {
500 pszName: LPWSTR,
501 dwClass: ULONG,
502 dwFlags: ULONG,
503 }}
504 extern "system" {
BCryptEnumAlgorithms( dwAlgOperations: ULONG, pAlgCount: *mut ULONG, ppAlgList: *mut *mut BCRYPT_ALGORITHM_IDENTIFIER, dwFlags: ULONG, ) -> NTSTATUS505 pub fn BCryptEnumAlgorithms(
506 dwAlgOperations: ULONG,
507 pAlgCount: *mut ULONG,
508 ppAlgList: *mut *mut BCRYPT_ALGORITHM_IDENTIFIER,
509 dwFlags: ULONG,
510 ) -> NTSTATUS;
511 }
512 STRUCT!{struct BCRYPT_PROVIDER_NAME {
513 pszProviderName: LPWSTR,
514 }}
515 extern "system" {
BCryptEnumProviders( pszAlgId: LPCWSTR, pImplCount: *mut ULONG, ppImplList: *mut *mut BCRYPT_PROVIDER_NAME, dwFlags: ULONG, ) -> NTSTATUS516 pub fn BCryptEnumProviders(
517 pszAlgId: LPCWSTR,
518 pImplCount: *mut ULONG,
519 ppImplList: *mut *mut BCRYPT_PROVIDER_NAME,
520 dwFlags: ULONG,
521 ) -> NTSTATUS;
522 }
523 pub const BCRYPT_PUBLIC_KEY_FLAG: ULONG = 0x00000001;
524 pub const BCRYPT_PRIVATE_KEY_FLAG: ULONG = 0x00000002;
525 extern "system" {
BCryptGetProperty( hObject: BCRYPT_HANDLE, pszProperty: LPCWSTR, pbOutput: PUCHAR, cbOutput: ULONG, pcbResult: *mut ULONG, dwFlags: ULONG, ) -> NTSTATUS526 pub fn BCryptGetProperty(
527 hObject: BCRYPT_HANDLE,
528 pszProperty: LPCWSTR,
529 pbOutput: PUCHAR,
530 cbOutput: ULONG,
531 pcbResult: *mut ULONG,
532 dwFlags: ULONG,
533 ) -> NTSTATUS;
BCryptSetProperty( hObject: BCRYPT_HANDLE, pszProperty: LPCWSTR, pbInput: PUCHAR, cbInput: ULONG, dwFlags: ULONG, ) -> NTSTATUS534 pub fn BCryptSetProperty(
535 hObject: BCRYPT_HANDLE,
536 pszProperty: LPCWSTR,
537 pbInput: PUCHAR,
538 cbInput: ULONG,
539 dwFlags: ULONG,
540 ) -> NTSTATUS;
BCryptCloseAlgorithmProvider( hAlgorithm: BCRYPT_ALG_HANDLE, dwFlags: ULONG, ) -> NTSTATUS541 pub fn BCryptCloseAlgorithmProvider(
542 hAlgorithm: BCRYPT_ALG_HANDLE,
543 dwFlags: ULONG,
544 ) -> NTSTATUS;
BCryptFreeBuffer( pvBuffer: PVOID, )545 pub fn BCryptFreeBuffer(
546 pvBuffer: PVOID,
547 );
BCryptGenerateSymmetricKey( hAlgorithm: BCRYPT_ALG_HANDLE, phKey: *mut BCRYPT_KEY_HANDLE, pbKeyObject: PUCHAR, cbKeyObject: ULONG, pbSecret: PUCHAR, cbSecret: ULONG, dwFlags: ULONG, ) -> NTSTATUS548 pub fn BCryptGenerateSymmetricKey(
549 hAlgorithm: BCRYPT_ALG_HANDLE,
550 phKey: *mut BCRYPT_KEY_HANDLE,
551 pbKeyObject: PUCHAR,
552 cbKeyObject: ULONG,
553 pbSecret: PUCHAR,
554 cbSecret: ULONG,
555 dwFlags: ULONG,
556 ) -> NTSTATUS;
BCryptGenerateKeyPair( hAlgorithm: BCRYPT_ALG_HANDLE, phKey: *mut BCRYPT_KEY_HANDLE, dwLength: ULONG, dwFlags: ULONG, ) -> NTSTATUS557 pub fn BCryptGenerateKeyPair(
558 hAlgorithm: BCRYPT_ALG_HANDLE,
559 phKey: *mut BCRYPT_KEY_HANDLE,
560 dwLength: ULONG,
561 dwFlags: ULONG,
562 ) -> NTSTATUS;
BCryptEncrypt( hKey: BCRYPT_KEY_HANDLE, pbInput: PUCHAR, cbInput: ULONG, pPaddingInfo: *mut VOID, pbIV: PUCHAR, cbIV: ULONG, pbOutput: PUCHAR, cbOutput: ULONG, pcbResult: *mut ULONG, dwFlags: ULONG, ) -> NTSTATUS563 pub fn BCryptEncrypt(
564 hKey: BCRYPT_KEY_HANDLE,
565 pbInput: PUCHAR,
566 cbInput: ULONG,
567 pPaddingInfo: *mut VOID,
568 pbIV: PUCHAR,
569 cbIV: ULONG,
570 pbOutput: PUCHAR,
571 cbOutput: ULONG,
572 pcbResult: *mut ULONG,
573 dwFlags: ULONG,
574 ) -> NTSTATUS;
BCryptDecrypt( hKey: BCRYPT_KEY_HANDLE, pbInput: PUCHAR, cbInput: ULONG, pPaddingInfo: *mut VOID, pbIV: PUCHAR, cbIV: ULONG, pbOutput: PUCHAR, cbOutput: ULONG, pcbResult: *mut ULONG, dwFlags: ULONG, ) -> NTSTATUS575 pub fn BCryptDecrypt(
576 hKey: BCRYPT_KEY_HANDLE,
577 pbInput: PUCHAR,
578 cbInput: ULONG,
579 pPaddingInfo: *mut VOID,
580 pbIV: PUCHAR,
581 cbIV: ULONG,
582 pbOutput: PUCHAR,
583 cbOutput: ULONG,
584 pcbResult: *mut ULONG,
585 dwFlags: ULONG,
586 ) -> NTSTATUS;
BCryptExportKey( hKey: BCRYPT_KEY_HANDLE, hExportKey: BCRYPT_KEY_HANDLE, pszBlobType: LPCWSTR, pbOutput: PUCHAR, cbOutput: ULONG, pcbResult: *mut ULONG, dwFlags: ULONG, ) -> NTSTATUS587 pub fn BCryptExportKey(
588 hKey: BCRYPT_KEY_HANDLE,
589 hExportKey: BCRYPT_KEY_HANDLE,
590 pszBlobType: LPCWSTR,
591 pbOutput: PUCHAR,
592 cbOutput: ULONG,
593 pcbResult: *mut ULONG,
594 dwFlags: ULONG,
595 ) -> NTSTATUS;
BCryptImportKey( hAlgorithm: BCRYPT_ALG_HANDLE, hImportKey: BCRYPT_KEY_HANDLE, pszBlobType: LPCWSTR, phKey: *mut BCRYPT_KEY_HANDLE, pbKeyObject: PUCHAR, cbKeyObject: ULONG, pbInput: PUCHAR, cbInput: ULONG, dwFlags: ULONG, ) -> NTSTATUS596 pub fn BCryptImportKey(
597 hAlgorithm: BCRYPT_ALG_HANDLE,
598 hImportKey: BCRYPT_KEY_HANDLE,
599 pszBlobType: LPCWSTR,
600 phKey: *mut BCRYPT_KEY_HANDLE,
601 pbKeyObject: PUCHAR,
602 cbKeyObject: ULONG,
603 pbInput: PUCHAR,
604 cbInput: ULONG,
605 dwFlags: ULONG,
606 ) -> NTSTATUS;
607 }
608 pub const BCRYPT_NO_KEY_VALIDATION: ULONG = 0x00000008;
609 extern "system" {
BCryptImportKeyPair( hAlgorithm: BCRYPT_ALG_HANDLE, hImportKey: BCRYPT_KEY_HANDLE, pszBlobType: LPCWSTR, phKey: *mut BCRYPT_KEY_HANDLE, pbInput: PUCHAR, cbInput: ULONG, dwFlags: ULONG, ) -> NTSTATUS610 pub fn BCryptImportKeyPair(
611 hAlgorithm: BCRYPT_ALG_HANDLE,
612 hImportKey: BCRYPT_KEY_HANDLE,
613 pszBlobType: LPCWSTR,
614 phKey: *mut BCRYPT_KEY_HANDLE,
615 pbInput: PUCHAR,
616 cbInput: ULONG,
617 dwFlags: ULONG,
618 ) -> NTSTATUS;
BCryptDuplicateKey( hKey: BCRYPT_KEY_HANDLE, phNewKey: *mut BCRYPT_KEY_HANDLE, pbKeyObject: PUCHAR, cbKeyObject: ULONG, dwFlags: ULONG, ) -> NTSTATUS619 pub fn BCryptDuplicateKey(
620 hKey: BCRYPT_KEY_HANDLE,
621 phNewKey: *mut BCRYPT_KEY_HANDLE,
622 pbKeyObject: PUCHAR,
623 cbKeyObject: ULONG,
624 dwFlags: ULONG,
625 ) -> NTSTATUS;
BCryptFinalizeKeyPair( hKey: BCRYPT_KEY_HANDLE, dwFlags: ULONG, ) -> NTSTATUS626 pub fn BCryptFinalizeKeyPair(
627 hKey: BCRYPT_KEY_HANDLE,
628 dwFlags: ULONG,
629 ) -> NTSTATUS;
BCryptDestroyKey( hKey: BCRYPT_KEY_HANDLE, ) -> NTSTATUS630 pub fn BCryptDestroyKey(
631 hKey: BCRYPT_KEY_HANDLE,
632 ) -> NTSTATUS;
BCryptDestroySecret( hSecret: BCRYPT_SECRET_HANDLE, ) -> NTSTATUS633 pub fn BCryptDestroySecret(
634 hSecret: BCRYPT_SECRET_HANDLE,
635 ) -> NTSTATUS;
BCryptSignHash( hKey: BCRYPT_KEY_HANDLE, pPaddingInfo: *mut VOID, pbInput: PUCHAR, cbInput: ULONG, pbOutput: PUCHAR, cbOutput: ULONG, pcbResult: *mut ULONG, dwFlags: ULONG, ) -> NTSTATUS636 pub fn BCryptSignHash(
637 hKey: BCRYPT_KEY_HANDLE,
638 pPaddingInfo: *mut VOID,
639 pbInput: PUCHAR,
640 cbInput: ULONG,
641 pbOutput: PUCHAR,
642 cbOutput: ULONG,
643 pcbResult: *mut ULONG,
644 dwFlags: ULONG,
645 ) -> NTSTATUS;
BCryptVerifySignature( hKey: BCRYPT_KEY_HANDLE, pPaddingInfo: *mut VOID, pbHash: PUCHAR, cbHash: ULONG, pbSignature: PUCHAR, cbSignature: ULONG, dwFlags: ULONG, ) -> NTSTATUS646 pub fn BCryptVerifySignature(
647 hKey: BCRYPT_KEY_HANDLE,
648 pPaddingInfo: *mut VOID,
649 pbHash: PUCHAR,
650 cbHash: ULONG,
651 pbSignature: PUCHAR,
652 cbSignature: ULONG,
653 dwFlags: ULONG,
654 ) -> NTSTATUS;
BCryptSecretAgreement( hPrivKey: BCRYPT_KEY_HANDLE, hPubKey: BCRYPT_KEY_HANDLE, phAgreedSecret: *mut BCRYPT_SECRET_HANDLE, dwFlags: ULONG, ) -> NTSTATUS655 pub fn BCryptSecretAgreement(
656 hPrivKey: BCRYPT_KEY_HANDLE,
657 hPubKey: BCRYPT_KEY_HANDLE,
658 phAgreedSecret: *mut BCRYPT_SECRET_HANDLE,
659 dwFlags: ULONG,
660 ) -> NTSTATUS;
BCryptDeriveKey( hSharedSecret: BCRYPT_SECRET_HANDLE, pwszKDF: LPCWSTR, pParameterList: *mut BCryptBufferDesc, pbDerivedKey: PUCHAR, cbDerivedKey: ULONG, pcbResult: *mut ULONG, dwFlags: ULONG, ) -> NTSTATUS661 pub fn BCryptDeriveKey(
662 hSharedSecret: BCRYPT_SECRET_HANDLE,
663 pwszKDF: LPCWSTR,
664 pParameterList: *mut BCryptBufferDesc,
665 pbDerivedKey: PUCHAR,
666 cbDerivedKey: ULONG,
667 pcbResult: *mut ULONG,
668 dwFlags: ULONG,
669 ) -> NTSTATUS;
BCryptKeyDerivation( hKey: BCRYPT_KEY_HANDLE, pParameterList: *mut BCryptBufferDesc, pbDerivedKey: PUCHAR, cbDerivedKey: ULONG, pcbResult: *mut ULONG, dwFlags: ULONG, ) -> NTSTATUS670 pub fn BCryptKeyDerivation(
671 hKey: BCRYPT_KEY_HANDLE,
672 pParameterList: *mut BCryptBufferDesc,
673 pbDerivedKey: PUCHAR,
674 cbDerivedKey: ULONG,
675 pcbResult: *mut ULONG,
676 dwFlags: ULONG,
677 ) -> NTSTATUS;
BCryptCreateHash( hAlgorithm: BCRYPT_ALG_HANDLE, phHash: *mut BCRYPT_HASH_HANDLE, pbHashObject: PUCHAR, cbHashObject: ULONG, pbSecret: PUCHAR, cbSecret: ULONG, dwFlags: ULONG, ) -> NTSTATUS678 pub fn BCryptCreateHash(
679 hAlgorithm: BCRYPT_ALG_HANDLE,
680 phHash: *mut BCRYPT_HASH_HANDLE,
681 pbHashObject: PUCHAR,
682 cbHashObject: ULONG,
683 pbSecret: PUCHAR,
684 cbSecret: ULONG,
685 dwFlags: ULONG,
686 ) -> NTSTATUS;
BCryptHashData( hHash: BCRYPT_HASH_HANDLE, pbInput: PUCHAR, cbInput: ULONG, dwFlags: ULONG, ) -> NTSTATUS687 pub fn BCryptHashData(
688 hHash: BCRYPT_HASH_HANDLE,
689 pbInput: PUCHAR,
690 cbInput: ULONG,
691 dwFlags: ULONG,
692 ) -> NTSTATUS;
BCryptFinishHash( hHash: BCRYPT_HASH_HANDLE, pbOutput: PUCHAR, cbOutput: ULONG, dwFlags: ULONG, ) -> NTSTATUS693 pub fn BCryptFinishHash(
694 hHash: BCRYPT_HASH_HANDLE,
695 pbOutput: PUCHAR,
696 cbOutput: ULONG,
697 dwFlags: ULONG,
698 ) -> NTSTATUS;
BCryptCreateMultiHash( hAlgorithm: BCRYPT_ALG_HANDLE, phHash: *mut BCRYPT_HASH_HANDLE, nHashes: ULONG, pbHashObject: PUCHAR, cbHashObject: ULONG, pbSecret: PUCHAR, cbSecret: ULONG, dwFlags: ULONG, ) -> NTSTATUS699 pub fn BCryptCreateMultiHash(
700 hAlgorithm: BCRYPT_ALG_HANDLE,
701 phHash: *mut BCRYPT_HASH_HANDLE,
702 nHashes: ULONG,
703 pbHashObject: PUCHAR,
704 cbHashObject: ULONG,
705 pbSecret: PUCHAR,
706 cbSecret: ULONG,
707 dwFlags: ULONG,
708 ) -> NTSTATUS;
BCryptProcessMultiOperations( hObject: BCRYPT_HANDLE, operationType: BCRYPT_MULTI_OPERATION_TYPE, pOperations: PVOID, cbOperations: ULONG, dwFlags: ULONG, ) -> NTSTATUS709 pub fn BCryptProcessMultiOperations(
710 hObject: BCRYPT_HANDLE,
711 operationType: BCRYPT_MULTI_OPERATION_TYPE,
712 pOperations: PVOID,
713 cbOperations: ULONG,
714 dwFlags: ULONG,
715 ) -> NTSTATUS;
BCryptDuplicateHash( hHash: BCRYPT_HASH_HANDLE, phNewHash: *mut BCRYPT_HASH_HANDLE, pbHashObject: PUCHAR, cbHashObject: ULONG, dwFlags: ULONG, ) -> NTSTATUS716 pub fn BCryptDuplicateHash(
717 hHash: BCRYPT_HASH_HANDLE,
718 phNewHash: *mut BCRYPT_HASH_HANDLE,
719 pbHashObject: PUCHAR,
720 cbHashObject: ULONG,
721 dwFlags: ULONG,
722 ) -> NTSTATUS;
BCryptDestroyHash( hHash: BCRYPT_HASH_HANDLE, ) -> NTSTATUS723 pub fn BCryptDestroyHash(
724 hHash: BCRYPT_HASH_HANDLE,
725 ) -> NTSTATUS;
BCryptHash( hAlgorithm: BCRYPT_ALG_HANDLE, pbSecret: PUCHAR, cbSecret: ULONG, pbInput: PUCHAR, cbInput: ULONG, pbOutput: PUCHAR, cbOutput: ULONG, ) -> NTSTATUS726 pub fn BCryptHash(
727 hAlgorithm: BCRYPT_ALG_HANDLE,
728 pbSecret: PUCHAR,
729 cbSecret: ULONG,
730 pbInput: PUCHAR,
731 cbInput: ULONG,
732 pbOutput: PUCHAR,
733 cbOutput: ULONG,
734 ) -> NTSTATUS;
735 }
736 pub const BCRYPT_RNG_USE_ENTROPY_IN_BUFFER: ULONG = 0x00000001;
737 pub const BCRYPT_USE_SYSTEM_PREFERRED_RNG: ULONG = 0x00000002;
738 extern "system" {
BCryptGenRandom( hAlgorithm: BCRYPT_ALG_HANDLE, pbBuffer: PUCHAR, cbBuffer: ULONG, dwFlags: ULONG, ) -> NTSTATUS739 pub fn BCryptGenRandom(
740 hAlgorithm: BCRYPT_ALG_HANDLE,
741 pbBuffer: PUCHAR,
742 cbBuffer: ULONG,
743 dwFlags: ULONG,
744 ) -> NTSTATUS;
BCryptDeriveKeyCapi( hHash: BCRYPT_HASH_HANDLE, hTargetAlg: BCRYPT_ALG_HANDLE, pbDerivedKey: PUCHAR, cbDerivedKey: ULONG, dwFlags: ULONG, ) -> NTSTATUS745 pub fn BCryptDeriveKeyCapi(
746 hHash: BCRYPT_HASH_HANDLE,
747 hTargetAlg: BCRYPT_ALG_HANDLE,
748 pbDerivedKey: PUCHAR,
749 cbDerivedKey: ULONG,
750 dwFlags: ULONG,
751 ) -> NTSTATUS;
BCryptDeriveKeyPBKDF2( hPrf: BCRYPT_ALG_HANDLE, pbPassword: PUCHAR, cbPassword: ULONG, pbSalt: PUCHAR, cbSalt: ULONG, cIterations: ULONGLONG, pbDerivedKey: PUCHAR, cbDerivedKey: ULONG, dwFlags: ULONG, ) -> NTSTATUS752 pub fn BCryptDeriveKeyPBKDF2(
753 hPrf: BCRYPT_ALG_HANDLE,
754 pbPassword: PUCHAR,
755 cbPassword: ULONG,
756 pbSalt: PUCHAR,
757 cbSalt: ULONG,
758 cIterations: ULONGLONG,
759 pbDerivedKey: PUCHAR,
760 cbDerivedKey: ULONG,
761 dwFlags: ULONG,
762 ) -> NTSTATUS;
763 }
764 STRUCT!{struct BCRYPT_INTERFACE_VERSION {
765 MajorVersion: USHORT,
766 MinorVersion: USHORT,
767 }}
768 pub type PBCRYPT_INTERFACE_VERSION = *mut BCRYPT_INTERFACE_VERSION;
769 #[inline]
BCRYPT_IS_INTERFACE_VERSION_COMPATIBLE( loader: BCRYPT_INTERFACE_VERSION, provider: BCRYPT_INTERFACE_VERSION, ) -> bool770 pub fn BCRYPT_IS_INTERFACE_VERSION_COMPATIBLE(
771 loader: BCRYPT_INTERFACE_VERSION,
772 provider: BCRYPT_INTERFACE_VERSION,
773 ) -> bool {
774 loader.MajorVersion <= provider.MajorVersion
775 }
776 pub const BCRYPT_CIPHER_INTERFACE_VERSION_1: BCRYPT_INTERFACE_VERSION =
777 BCRYPT_MAKE_INTERFACE_VERSION!(1, 0);
778 pub const BCRYPT_HASH_INTERFACE_VERSION_1: BCRYPT_INTERFACE_VERSION =
779 BCRYPT_MAKE_INTERFACE_VERSION!(1, 0);
780 pub const BCRYPT_HASH_INTERFACE_MAJORVERSION_2: USHORT = 2;
781 pub const BCRYPT_HASH_INTERFACE_VERSION_2: BCRYPT_INTERFACE_VERSION =
782 BCRYPT_MAKE_INTERFACE_VERSION!(BCRYPT_HASH_INTERFACE_MAJORVERSION_2, 0);
783 pub const BCRYPT_ASYMMETRIC_ENCRYPTION_INTERFACE_VERSION_1: BCRYPT_INTERFACE_VERSION =
784 BCRYPT_MAKE_INTERFACE_VERSION!(1, 0);
785 pub const BCRYPT_SECRET_AGREEMENT_INTERFACE_VERSION_1: BCRYPT_INTERFACE_VERSION =
786 BCRYPT_MAKE_INTERFACE_VERSION!(1, 0);
787 pub const BCRYPT_SIGNATURE_INTERFACE_VERSION_1: BCRYPT_INTERFACE_VERSION =
788 BCRYPT_MAKE_INTERFACE_VERSION!(1, 0);
789 pub const BCRYPT_RNG_INTERFACE_VERSION_1: BCRYPT_INTERFACE_VERSION =
790 BCRYPT_MAKE_INTERFACE_VERSION!(1, 0);
791 pub const CRYPT_MIN_DEPENDENCIES: ULONG = 0x00000001;
792 pub const CRYPT_PROCESS_ISOLATE: ULONG = 0x00010000;
793 pub const CRYPT_UM: ULONG = 0x00000001;
794 pub const CRYPT_KM: ULONG = 0x00000002;
795 pub const CRYPT_MM: ULONG = 0x00000003;
796 pub const CRYPT_ANY: ULONG = 0x00000004;
797 pub const CRYPT_OVERWRITE: ULONG = 0x00000001;
798 pub const CRYPT_LOCAL: ULONG = 0x00000001;
799 pub const CRYPT_DOMAIN: ULONG = 0x00000002;
800 pub const CRYPT_EXCLUSIVE: ULONG = 0x00000001;
801 pub const CRYPT_OVERRIDE: ULONG = 0x00010000;
802 pub const CRYPT_ALL_FUNCTIONS: ULONG = 0x00000001;
803 pub const CRYPT_ALL_PROVIDERS: ULONG = 0x00000002;
804 pub const CRYPT_PRIORITY_TOP: ULONG = 0x00000000;
805 pub const CRYPT_PRIORITY_BOTTOM: ULONG = 0xFFFFFFFF;
806 pub const CRYPT_DEFAULT_CONTEXT: &'static str = "Default";
807 STRUCT!{struct CRYPT_INTERFACE_REG {
808 dwInterface: ULONG,
809 dwFlags: ULONG,
810 cFunctions: ULONG,
811 rgpszFunctions: *mut PWSTR,
812 }}
813 pub type PCRYPT_INTERFACE_REG = *mut CRYPT_INTERFACE_REG;
814 STRUCT!{struct CRYPT_IMAGE_REG {
815 pszImage: PWSTR,
816 cInterfaces: ULONG,
817 rgpInterfaces: *mut PCRYPT_INTERFACE_REG,
818 }}
819 pub type PCRYPT_IMAGE_REG = *mut CRYPT_IMAGE_REG;
820 STRUCT!{struct CRYPT_PROVIDER_REG {
821 cAliases: ULONG,
822 rgpszAliases: *mut PWSTR,
823 pUM: PCRYPT_IMAGE_REG,
824 pKM: PCRYPT_IMAGE_REG,
825 }}
826 pub type PCRYPT_PROVIDER_REG = *mut CRYPT_PROVIDER_REG;
827 STRUCT!{struct CRYPT_PROVIDERS {
828 cProviders: ULONG,
829 rgpszProviders: *mut PWSTR,
830 }}
831 pub type PCRYPT_PROVIDERS = *mut CRYPT_PROVIDERS;
832 STRUCT!{struct CRYPT_CONTEXT_CONFIG {
833 dwFlags: ULONG,
834 dwReserved: ULONG,
835 }}
836 pub type PCRYPT_CONTEXT_CONFIG = *mut CRYPT_CONTEXT_CONFIG;
837 STRUCT!{struct CRYPT_CONTEXT_FUNCTION_CONFIG {
838 dwFlags: ULONG,
839 dwReserved: ULONG,
840 }}
841 pub type PCRYPT_CONTEXT_FUNCTION_CONFIG = *mut CRYPT_CONTEXT_FUNCTION_CONFIG;
842 STRUCT!{struct CRYPT_CONTEXTS {
843 cContexts: ULONG,
844 rgpszContexts: *mut PWSTR,
845 }}
846 pub type PCRYPT_CONTEXTS = *mut CRYPT_CONTEXTS;
847 STRUCT!{struct CRYPT_CONTEXT_FUNCTIONS {
848 cFunctions: ULONG,
849 rgpszFunctions: *mut PWSTR,
850 }}
851 pub type PCRYPT_CONTEXT_FUNCTIONS = *mut CRYPT_CONTEXT_FUNCTIONS;
852 STRUCT!{struct CRYPT_CONTEXT_FUNCTION_PROVIDERS {
853 cProviders: ULONG,
854 rgpszProviders: *mut PWSTR,
855 }}
856 pub type PCRYPT_CONTEXT_FUNCTION_PROVIDERS = *mut CRYPT_CONTEXT_FUNCTION_PROVIDERS;
857 STRUCT!{struct CRYPT_PROPERTY_REF {
858 pszProperty: PWSTR,
859 cbValue: ULONG,
860 pbValue: PUCHAR,
861 }}
862 pub type PCRYPT_PROPERTY_REF = *mut CRYPT_PROPERTY_REF;
863 STRUCT!{struct CRYPT_IMAGE_REF {
864 pszImage: PWSTR,
865 dwFlags: ULONG,
866 }}
867 pub type PCRYPT_IMAGE_REF = *mut CRYPT_IMAGE_REF;
868 STRUCT!{struct CRYPT_PROVIDER_REF {
869 dwInterface: ULONG,
870 pszFunction: PWSTR,
871 pszProvider: PWSTR,
872 cProperties: ULONG,
873 rgpProperties: *mut PCRYPT_PROPERTY_REF,
874 pUM: PCRYPT_IMAGE_REF,
875 pKM: PCRYPT_IMAGE_REF,
876 }}
877 pub type PCRYPT_PROVIDER_REF = *mut CRYPT_PROVIDER_REF;
878 STRUCT!{struct CRYPT_PROVIDER_REFS {
879 cProviders: ULONG,
880 rgpProviders: *mut PCRYPT_PROVIDER_REF,
881 }}
882 pub type PCRYPT_PROVIDER_REFS = *mut CRYPT_PROVIDER_REFS;
883 extern "system" {
BCryptQueryProviderRegistration( pszProvider: LPCWSTR, dwMode: ULONG, dwInterface: ULONG, pcbBuffer: *mut ULONG, ppBuffer: *mut PCRYPT_PROVIDER_REG, ) -> NTSTATUS884 pub fn BCryptQueryProviderRegistration(
885 pszProvider: LPCWSTR,
886 dwMode: ULONG,
887 dwInterface: ULONG,
888 pcbBuffer: *mut ULONG,
889 ppBuffer: *mut PCRYPT_PROVIDER_REG,
890 ) -> NTSTATUS;
BCryptEnumRegisteredProviders( pcbBuffer: *mut ULONG, ppBuffer: *mut PCRYPT_PROVIDERS, ) -> NTSTATUS891 pub fn BCryptEnumRegisteredProviders(
892 pcbBuffer: *mut ULONG,
893 ppBuffer: *mut PCRYPT_PROVIDERS,
894 ) -> NTSTATUS;
BCryptCreateContext( dwTable: ULONG, pszContext: LPCWSTR, pConfig: PCRYPT_CONTEXT_CONFIG, ) -> NTSTATUS895 pub fn BCryptCreateContext(
896 dwTable: ULONG,
897 pszContext: LPCWSTR,
898 pConfig: PCRYPT_CONTEXT_CONFIG,
899 ) -> NTSTATUS;
BCryptDeleteContext( dwTable: ULONG, pszContext: LPCWSTR, ) -> NTSTATUS900 pub fn BCryptDeleteContext(
901 dwTable: ULONG,
902 pszContext: LPCWSTR,
903 ) -> NTSTATUS;
BCryptEnumContexts( dwTable: ULONG, pcbBuffer: *mut ULONG, ppBuffer: *mut PCRYPT_CONTEXTS, ) -> NTSTATUS904 pub fn BCryptEnumContexts(
905 dwTable: ULONG,
906 pcbBuffer: *mut ULONG,
907 ppBuffer: *mut PCRYPT_CONTEXTS,
908 ) -> NTSTATUS;
BCryptConfigureContext( dwTable: ULONG, pszContext: LPCWSTR, pConfig: PCRYPT_CONTEXT_CONFIG, ) -> NTSTATUS909 pub fn BCryptConfigureContext(
910 dwTable: ULONG,
911 pszContext: LPCWSTR,
912 pConfig: PCRYPT_CONTEXT_CONFIG,
913 ) -> NTSTATUS;
BCryptQueryContextConfiguration( dwTable: ULONG, pszContext: LPCWSTR, pcbBuffer: *mut ULONG, ppBuffer: *mut PCRYPT_CONTEXT_CONFIG, ) -> NTSTATUS914 pub fn BCryptQueryContextConfiguration(
915 dwTable: ULONG,
916 pszContext: LPCWSTR,
917 pcbBuffer: *mut ULONG,
918 ppBuffer: *mut PCRYPT_CONTEXT_CONFIG,
919 ) -> NTSTATUS;
BCryptAddContextFunction( dwTable: ULONG, pszContext: LPCWSTR, dwInterface: ULONG, pszFunction: LPCWSTR, dwPosition: ULONG, ) -> NTSTATUS920 pub fn BCryptAddContextFunction(
921 dwTable: ULONG,
922 pszContext: LPCWSTR,
923 dwInterface: ULONG,
924 pszFunction: LPCWSTR,
925 dwPosition: ULONG,
926 ) -> NTSTATUS;
BCryptRemoveContextFunction( dwTable: ULONG, pszContext: LPCWSTR, dwInterface: ULONG, pszFunction: LPCWSTR, ) -> NTSTATUS927 pub fn BCryptRemoveContextFunction(
928 dwTable: ULONG,
929 pszContext: LPCWSTR,
930 dwInterface: ULONG,
931 pszFunction: LPCWSTR,
932 ) -> NTSTATUS;
BCryptEnumContextFunctions( dwTable: ULONG, pszContext: LPCWSTR, dwInterface: ULONG, pcbBuffer: *mut ULONG, ppBuffer: *mut PCRYPT_CONTEXT_FUNCTIONS, ) -> NTSTATUS933 pub fn BCryptEnumContextFunctions(
934 dwTable: ULONG,
935 pszContext: LPCWSTR,
936 dwInterface: ULONG,
937 pcbBuffer: *mut ULONG,
938 ppBuffer: *mut PCRYPT_CONTEXT_FUNCTIONS,
939 ) -> NTSTATUS;
BCryptConfigureContextFunction( dwTable: ULONG, pszContext: LPCWSTR, dwInterface: ULONG, pszFunction: LPCWSTR, pConfig: PCRYPT_CONTEXT_FUNCTION_CONFIG, ) -> NTSTATUS940 pub fn BCryptConfigureContextFunction(
941 dwTable: ULONG,
942 pszContext: LPCWSTR,
943 dwInterface: ULONG,
944 pszFunction: LPCWSTR,
945 pConfig: PCRYPT_CONTEXT_FUNCTION_CONFIG,
946 ) -> NTSTATUS;
BCryptQueryContextFunctionConfiguration( dwTable: ULONG, pszContext: LPCWSTR, dwInterface: ULONG, pszFunction: LPCWSTR, pcbBuffer: *mut ULONG, ppBuffer: *mut PCRYPT_CONTEXT_FUNCTION_CONFIG, ) -> NTSTATUS947 pub fn BCryptQueryContextFunctionConfiguration(
948 dwTable: ULONG,
949 pszContext: LPCWSTR,
950 dwInterface: ULONG,
951 pszFunction: LPCWSTR,
952 pcbBuffer: *mut ULONG,
953 ppBuffer: *mut PCRYPT_CONTEXT_FUNCTION_CONFIG,
954 ) -> NTSTATUS;
BCryptEnumContextFunctionProviders( dwTable: ULONG, pszContext: LPCWSTR, dwInterface: ULONG, pszFunction: LPCWSTR, pcbBuffer: *mut ULONG, ppBuffer: *mut PCRYPT_CONTEXT_FUNCTION_PROVIDERS, ) -> NTSTATUS955 pub fn BCryptEnumContextFunctionProviders(
956 dwTable: ULONG,
957 pszContext: LPCWSTR,
958 dwInterface: ULONG,
959 pszFunction: LPCWSTR,
960 pcbBuffer: *mut ULONG,
961 ppBuffer: *mut PCRYPT_CONTEXT_FUNCTION_PROVIDERS,
962 ) -> NTSTATUS;
BCryptSetContextFunctionProperty( dwTable: ULONG, pszContext: LPCWSTR, dwInterface: ULONG, pszFunction: LPCWSTR, pszProperty: LPCWSTR, cbValue: ULONG, pbValue: PUCHAR, ) -> NTSTATUS963 pub fn BCryptSetContextFunctionProperty(
964 dwTable: ULONG,
965 pszContext: LPCWSTR,
966 dwInterface: ULONG,
967 pszFunction: LPCWSTR,
968 pszProperty: LPCWSTR,
969 cbValue: ULONG,
970 pbValue: PUCHAR,
971 ) -> NTSTATUS;
BCryptQueryContextFunctionProperty( dwTable: ULONG, pszContext: LPCWSTR, dwInterface: ULONG, pszFunction: LPCWSTR, pszProperty: LPCWSTR, pcbValue: *mut ULONG, ppbValue: *mut PUCHAR, ) -> NTSTATUS972 pub fn BCryptQueryContextFunctionProperty(
973 dwTable: ULONG,
974 pszContext: LPCWSTR,
975 dwInterface: ULONG,
976 pszFunction: LPCWSTR,
977 pszProperty: LPCWSTR,
978 pcbValue: *mut ULONG,
979 ppbValue: *mut PUCHAR,
980 ) -> NTSTATUS;
BCryptRegisterConfigChangeNotify( phEvent: *mut HANDLE, ) -> NTSTATUS981 pub fn BCryptRegisterConfigChangeNotify(
982 phEvent: *mut HANDLE,
983 ) -> NTSTATUS;
BCryptUnregisterConfigChangeNotify( hEvent: HANDLE, ) -> NTSTATUS984 pub fn BCryptUnregisterConfigChangeNotify(
985 hEvent: HANDLE,
986 ) -> NTSTATUS;
BCryptResolveProviders( pszContext: LPCWSTR, dwInterface: ULONG, pszFunction: LPCWSTR, pszProvider: LPCWSTR, dwMode: ULONG, dwFlags: ULONG, pcbBuffer: *mut ULONG, ppBuffer: *mut PCRYPT_PROVIDER_REFS, ) -> NTSTATUS987 pub fn BCryptResolveProviders(
988 pszContext: LPCWSTR,
989 dwInterface: ULONG,
990 pszFunction: LPCWSTR,
991 pszProvider: LPCWSTR,
992 dwMode: ULONG,
993 dwFlags: ULONG,
994 pcbBuffer: *mut ULONG,
995 ppBuffer: *mut PCRYPT_PROVIDER_REFS,
996 ) -> NTSTATUS;
BCryptGetFipsAlgorithmMode( pfEnabled: *mut BOOLEAN, ) -> NTSTATUS997 pub fn BCryptGetFipsAlgorithmMode(
998 pfEnabled: *mut BOOLEAN,
999 ) -> NTSTATUS;
CngGetFipsAlgorithmMode() -> BOOLEAN1000 pub fn CngGetFipsAlgorithmMode() -> BOOLEAN;
1001 }
1002