#pragma once
#define __BCRYPT_H__
#include <winapifamily.h>
#if _MSC_VER >= 1200
#pragma warning(push)
#pragma warning(disable:4820) // padding added after data member
#endif
#pragma warning(disable:
4820
)
#ifdef __cplusplus
extern
"C"
{
#endif
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
#ifndef WINAPI
#define WINAPI __stdcall
#endif
#ifndef _NTDEF_
typedef _Return_type_success_(return >= 0) LONG NTSTATUS;
typedef
*
;
#endif
#ifndef BCRYPT_SUCCESS
#define BCRYPT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0)
#endif
#ifndef CONST
#define CONST const
#endif
#ifndef IN
#define IN
#endif
#ifndef OUT
#define OUT
#endif
#ifndef OPTIONAL
#define OPTIONAL
#endif
#define BCRYPT_OBJECT_ALIGNMENT 16
#define BCRYPT_STRUCT_ALIGNMENT
#define BCRYPT_KDF_HASH L"HASH"
#define BCRYPT_KDF_HMAC L"HMAC"
#define BCRYPT_KDF_TLS_PRF L"TLS_PRF"
#if (NTDDI_VERSION >= NTDDI_WIN7)
#define BCRYPT_KDF_SP80056A_CONCAT L"SP800_56A_CONCAT"
#endif
#if (NTDDI_VERSION >= NTDDI_WINBLUE)
#define BCRYPT_KDF_RAW_SECRET L"TRUNCATE"
#endif
#if (NTDDI_VERSION >= NTDDI_WIN10_RS4)
#define BCRYPT_KDF_HKDF L"HKDF"
#endif
#define KDF_HASH_ALGORITHM 0x0
#define KDF_SECRET_PREPEND 0x1
#define KDF_SECRET_APPEND 0x2
#define KDF_HMAC_KEY 0x3
#define KDF_TLS_PRF_LABEL 0x4
#define KDF_TLS_PRF_SEED 0x5
#define KDF_SECRET_HANDLE 0x6
#if (NTDDI_VERSION >= NTDDI_WIN7)
#define KDF_TLS_PRF_PROTOCOL 0x7
#define KDF_ALGORITHMID 0x8
#define KDF_PARTYUINFO 0x9
#define KDF_PARTYVINFO 0xA
#define KDF_SUPPPUBINFO 0xB
#define KDF_SUPPPRIVINFO 0xC
#endif
#if (NTDDI_VERSION >= NTDDI_WIN8)
#define KDF_LABEL 0xD
#define KDF_CONTEXT 0xE
#define KDF_SALT 0xF
#define KDF_ITERATION_COUNT 0x10
#define KDF_GENERIC_PARAMETER 0x11
#define KDF_KEYBITLENGTH 0x12
#endif
#if (NTDDI_VERSION >= NTDDI_WIN10_RS4)
#define KDF_HKDF_SALT 0x13 // This is used only for testing purposes
#define KDF_HKDF_INFO 0x14
#endif
#define KDF_USE_SECRET_AS_HMAC_KEY_FLAG 0x1
typedef
struct
__BCRYPT_KEY_LENGTHS_STRUCT
{
;
;
;
}
BCRYPT_KEY_LENGTHS_STRUCT
;
typedef
BCRYPT_KEY_LENGTHS_STRUCT
BCRYPT_AUTH_TAG_LENGTHS_STRUCT
;
typedef
struct
{
;
;
}
;
typedef
struct
{
;
*
;
}
;
typedef
struct
_BCRYPT_PKCS1_PADDING_INFO
{
;
}
BCRYPT_PKCS1_PADDING_INFO
;
typedef
struct
{
;
;
}
;
typedef
struct
_BCRYPT_OAEP_PADDING_INFO
{
;
;
;
}
;
#define BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO_VERSION 1
#define BCRYPT_AUTH_MODE_CHAIN_CALLS_FLAG 0x00000001
#define BCRYPT_AUTH_MODE_IN_PROGRESS_FLAG 0x00000002
typedef
struct
_BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO
{
;
;
;
;
;
;
;
;
;
;
;
;
;
}
BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO
, *
PBCRYPT_AUTHENTICATED_CIPHER_MODE_INFO
;
#define BCRYPT_INIT_AUTH_MODE_INFO(_AUTH_INFO_STRUCT_) \
RtlZeroMemory((&_AUTH_INFO_STRUCT_), sizeof(BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO)); \
(_AUTH_INFO_STRUCT_).cbSize = sizeof(BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO); \
(_AUTH_INFO_STRUCT_).dwInfoVersion = BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO_VERSION;
#define BCRYPT_OPAQUE_KEY_BLOB L"OpaqueKeyBlob"
#define BCRYPT_KEY_DATA_BLOB L"KeyDataBlob"
#if (NTDDI_VERSION >= NTDDI_WIN7)
#define BCRYPT_AES_WRAP_KEY_BLOB L"Rfc3565KeyWrapBlob"
#endif
#define BCRYPT_OBJECT_LENGTH L"ObjectLength"
#define BCRYPT_ALGORITHM_NAME L"AlgorithmName"
#define BCRYPT_PROVIDER_HANDLE L"ProviderHandle"
#define BCRYPT_CHAINING_MODE L"ChainingMode"
#define BCRYPT_BLOCK_LENGTH L"BlockLength"
#define BCRYPT_KEY_LENGTH L"KeyLength"
#define BCRYPT_KEY_OBJECT_LENGTH L"KeyObjectLength"
#define BCRYPT_KEY_STRENGTH L"KeyStrength"
#define BCRYPT_KEY_LENGTHS L"KeyLengths"
#define BCRYPT_BLOCK_SIZE_LIST L"BlockSizeList"
#define BCRYPT_EFFECTIVE_KEY_LENGTH L"EffectiveKeyLength"
#define BCRYPT_HASH_LENGTH L"HashDigestLength"
#define BCRYPT_HASH_OID_LIST L"HashOIDList"
#define BCRYPT_PADDING_SCHEMES L"PaddingSchemes"
#define BCRYPT_SIGNATURE_LENGTH L"SignatureLength"
#define BCRYPT_HASH_BLOCK_LENGTH L"HashBlockLength"
#define BCRYPT_AUTH_TAG_LENGTH L"AuthTagLength"
#if (NTDDI_VERSION >= NTDDI_WIN7)
#define BCRYPT_PRIMITIVE_TYPE L"PrimitiveType"
#define BCRYPT_IS_KEYED_HASH L"IsKeyedHash"
#endif
#if (NTDDI_VERSION >= NTDDI_WIN8)
#define BCRYPT_IS_REUSABLE_HASH L"IsReusableHash"
#define BCRYPT_MESSAGE_BLOCK_LENGTH L"MessageBlockLength"
#endif
#if (NTDDI_VERSION >= NTDDI_WIN8)
#define BCRYPT_PUBLIC_KEY_LENGTH L"PublicKeyLength"
#endif
#define BCRYPT_PCP_PLATFORM_TYPE_PROPERTY L"PCP_PLATFORM_TYPE"
#define BCRYPT_PCP_PROVIDER_VERSION_PROPERTY L"PCP_PROVIDER_VERSION"
#if (NTDDI_VERSION > NTDDI_WINBLUE || (NTDDI_VERSION == NTDDI_WINBLUE && defined(WINBLUE_KBSPRING14)))
#define BCRYPT_MULTI_OBJECT_LENGTH L"MultiObjectLength"
#endif
#if (NTDDI_VERSION >= NTDDI_WIN10_RS4)
#define BCRYPT_IS_IFX_TPM_WEAK_KEY L"IsIfxTpmWeakKey"
#define BCRYPT_HKDF_HASH_ALGORITHM L"HkdfHashAlgorithm"
#define BCRYPT_HKDF_SALT_AND_FINALIZE L"HkdfSaltAndFinalize"
#define BCRYPT_HKDF_PRK_AND_FINALIZE L"HkdfPrkAndFinalize"
#endif
#define BCRYPT_INITIALIZATION_VECTOR L"IV"
#define BCRYPT_CHAIN_MODE_NA L"ChainingModeN/A"
#define BCRYPT_CHAIN_MODE_CBC L"ChainingModeCBC"
#define BCRYPT_CHAIN_MODE_ECB L"ChainingModeECB"
#define BCRYPT_CHAIN_MODE_CFB L"ChainingModeCFB"
#define BCRYPT_CHAIN_MODE_CCM L"ChainingModeCCM"
#define BCRYPT_CHAIN_MODE_GCM L"ChainingModeGCM"
#define BCRYPT_SUPPORTED_PAD_ROUTER 0x00000001
#define BCRYPT_SUPPORTED_PAD_PKCS1_ENC 0x00000002
#define BCRYPT_SUPPORTED_PAD_PKCS1_SIG 0x00000004
#define BCRYPT_SUPPORTED_PAD_OAEP 0x00000008
#define BCRYPT_SUPPORTED_PAD_PSS 0x00000010
#define BCRYPT_PROV_DISPATCH 0x00000001 // BCryptOpenAlgorithmProvider
#define BCRYPT_BLOCK_PADDING 0x00000001 // BCryptEncrypt/Decrypt
#define BCRYPT_PAD_NONE 0x00000001
#define BCRYPT_PAD_PKCS1 0x00000002 // BCryptEncrypt/Decrypt BCryptSignHash/VerifySignature
#define BCRYPT_PAD_OAEP 0x00000004 // BCryptEncrypt/Decrypt
#define BCRYPT_PAD_PSS 0x00000008 // BCryptSignHash/VerifySignature
#if (NTDDI_VERSION >= NTDDI_WINBLUE)
#define BCRYPT_PAD_PKCS1_OPTIONAL_HASH_OID 0x00000010 //BCryptVerifySignature
#endif
#define BCRYPTBUFFER_VERSION 0
typedef
struct
{
;
;
;
}
, *
;
typedef
struct
{
;
;
;
}
, *
;
typedef
;
typedef
;
typedef
;
typedef
;
typedef
;
#define BCRYPT_PUBLIC_KEY_BLOB L"PUBLICBLOB"
#define BCRYPT_PRIVATE_KEY_BLOB L"PRIVATEBLOB"
typedef
struct
{
;
}
;
#define BCRYPT_RSAPUBLIC_BLOB L"RSAPUBLICBLOB"
#define BCRYPT_RSAPRIVATE_BLOB L"RSAPRIVATEBLOB"
#define LEGACY_RSAPUBLIC_BLOB L"CAPIPUBLICBLOB"
#define LEGACY_RSAPRIVATE_BLOB L"CAPIPRIVATEBLOB"
#define BCRYPT_RSAPUBLIC_MAGIC 0x31415352 // RSA1
#define BCRYPT_RSAPRIVATE_MAGIC 0x32415352 // RSA2
typedef
struct
{
;
;
;
;
;
;
}
;
#define BCRYPT_RSAFULLPRIVATE_BLOB L"RSAFULLPRIVATEBLOB"
#define BCRYPT_RSAFULLPRIVATE_MAGIC 0x33415352 // RSA3
#if (NTDDI_VERSION >= NTDDI_WIN8)
#define BCRYPT_GLOBAL_PARAMETERS L"SecretAgreementParam"
#define BCRYPT_PRIVATE_KEY L"PrivKeyVal"
#endif
#define BCRYPT_ECCPUBLIC_BLOB L"ECCPUBLICBLOB"
#define BCRYPT_ECCPRIVATE_BLOB L"ECCPRIVATEBLOB"
#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
#define BCRYPT_ECCFULLPUBLIC_BLOB L"ECCFULLPUBLICBLOB"
#define BCRYPT_ECCFULLPRIVATE_BLOB L"ECCFULLPRIVATEBLOB"
#define SSL_ECCPUBLIC_BLOB L"SSLECCPUBLICBLOB"
#endif
#define BCRYPT_ECDH_PUBLIC_P256_MAGIC 0x314B4345 // ECK1
#define BCRYPT_ECDH_PRIVATE_P256_MAGIC 0x324B4345 // ECK2
#define BCRYPT_ECDH_PUBLIC_P384_MAGIC 0x334B4345 // ECK3
#define BCRYPT_ECDH_PRIVATE_P384_MAGIC 0x344B4345 // ECK4
#define BCRYPT_ECDH_PUBLIC_P521_MAGIC 0x354B4345 // ECK5
#define BCRYPT_ECDH_PRIVATE_P521_MAGIC 0x364B4345 // ECK6
#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
#define BCRYPT_ECDH_PUBLIC_GENERIC_MAGIC 0x504B4345 // ECKP
#define BCRYPT_ECDH_PRIVATE_GENERIC_MAGIC 0x564B4345 // ECKV
#endif
#define BCRYPT_ECDSA_PUBLIC_P256_MAGIC 0x31534345 // ECS1
#define BCRYPT_ECDSA_PRIVATE_P256_MAGIC 0x32534345 // ECS2
#define BCRYPT_ECDSA_PUBLIC_P384_MAGIC 0x33534345 // ECS3
#define BCRYPT_ECDSA_PRIVATE_P384_MAGIC 0x34534345 // ECS4
#define BCRYPT_ECDSA_PUBLIC_P521_MAGIC 0x35534345 // ECS5
#define BCRYPT_ECDSA_PRIVATE_P521_MAGIC 0x36534345 // ECS6
#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
#define BCRYPT_ECDSA_PUBLIC_GENERIC_MAGIC 0x50444345 // ECDP
#define BCRYPT_ECDSA_PRIVATE_GENERIC_MAGIC 0x56444345 // ECDV
#endif
typedef
struct
{
;
;
}
, *
;
#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
typedef
struct
{
;
;
}
, *
;
#define BCRYPT_ECC_FULLKEY_BLOB_V1 0x1
typedef
enum
{
BCRYPT_ECC_PRIME_SHORT_WEIERSTRASS_CURVE
=
0x1
,
BCRYPT_ECC_PRIME_TWISTED_EDWARDS_CURVE
=
0x2
,
BCRYPT_ECC_PRIME_MONTGOMERY_CURVE
=
0x3
}
;
typedef
enum
{
BCRYPT_NO_CURVE_GENERATION_ALG_ID
=
0x0
}
;
typedef
struct
{
;
;
;
;
;
;
;
;
}
, *
;
#endif
#define BCRYPT_DH_PUBLIC_BLOB L"DHPUBLICBLOB"
#define BCRYPT_DH_PRIVATE_BLOB L"DHPRIVATEBLOB"
#define LEGACY_DH_PUBLIC_BLOB L"CAPIDHPUBLICBLOB"
#define LEGACY_DH_PRIVATE_BLOB L"CAPIDHPRIVATEBLOB"
#define BCRYPT_DH_PUBLIC_MAGIC 0x42504844 // DHPB
#define BCRYPT_DH_PRIVATE_MAGIC 0x56504844 // DHPV
typedef
struct
{
;
;
}
, *
;
#define BCRYPT_DH_PARAMETERS L"DHParameters"
#define BCRYPT_DH_PARAMETERS_MAGIC 0x4d504844 // DHPM
typedef _Struct_size_bytes_(cbLength) struct _BCRYPT_DH_PARAMETER_HEADER
{
;
;
;
} ;
#define BCRYPT_DSA_PUBLIC_BLOB L"DSAPUBLICBLOB"
#define BCRYPT_DSA_PRIVATE_BLOB L"DSAPRIVATEBLOB"
#define LEGACY_DSA_PUBLIC_BLOB L"CAPIDSAPUBLICBLOB"
#define LEGACY_DSA_PRIVATE_BLOB L"CAPIDSAPRIVATEBLOB"
#define LEGACY_DSA_V2_PUBLIC_BLOB L"V2CAPIDSAPUBLICBLOB"
#define LEGACY_DSA_V2_PRIVATE_BLOB L"V2CAPIDSAPRIVATEBLOB"
#define BCRYPT_DSA_PUBLIC_MAGIC 0x42505344 // DSPB
#define BCRYPT_DSA_PRIVATE_MAGIC 0x56505344 // DSPV
#if (NTDDI_VERSION >= NTDDI_WIN8)
#define BCRYPT_DSA_PUBLIC_MAGIC_V2 0x32425044 // DPB2
#define BCRYPT_DSA_PRIVATE_MAGIC_V2 0x32565044 // DPV2
#endif
typedef
struct
{
;
;
[
4
];
[
20
];
[
20
];
}
, *
;
#if (NTDDI_VERSION >= NTDDI_WIN8)
typedef
enum
{
,
DSA_HASH_ALGORITHM_SHA256
,
DSA_HASH_ALGORITHM_SHA512
}
;
typedef
enum
{
,
}
;
typedef
struct
{
;
;
;
;
;
;
[
4
];
}
, *
;
#endif
typedef
struct
{
;
;
;
} , *;
#define BCRYPT_KEY_DATA_BLOB_MAGIC 0x4d42444b //Key Data Blob Magic (KDBM)
#define BCRYPT_KEY_DATA_BLOB_VERSION1 0x1
#define BCRYPT_DSA_PARAMETERS L"DSAParameters"
#define BCRYPT_DSA_PARAMETERS_MAGIC 0x4d505344 // DSPM
#if (NTDDI_VERSION >= NTDDI_WIN8)
#define BCRYPT_DSA_PARAMETERS_MAGIC_V2 0x324d5044 // DPM2
#endif
typedef
struct
{
;
;
;
[
4
];
[
20
];
[
20
];
} ;
#if (NTDDI_VERSION >= NTDDI_WIN8)
typedef
struct
{
;
;
;
;
;
;
;
[
4
];
} ;
#endif
#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
#define BCRYPT_ECC_PARAMETERS L"ECCParameters"
#define BCRYPT_ECC_CURVE_NAME L"ECCCurveName"
#define BCRYPT_ECC_CURVE_NAME_LIST L"ECCCurveNameList"
#define BCRYPT_ECC_PARAMETERS_MAGIC 0x50434345 // ECCP
typedef
struct
{
;
*
;
}
;
#define BCRYPT_ECC_CURVE_BRAINPOOLP160R1 L"brainpoolP160r1"
#define BCRYPT_ECC_CURVE_BRAINPOOLP160T1 L"brainpoolP160t1"
#define BCRYPT_ECC_CURVE_BRAINPOOLP192R1 L"brainpoolP192r1"
#define BCRYPT_ECC_CURVE_BRAINPOOLP192T1 L"brainpoolP192t1"
#define BCRYPT_ECC_CURVE_BRAINPOOLP224R1 L"brainpoolP224r1"
#define BCRYPT_ECC_CURVE_BRAINPOOLP224T1 L"brainpoolP224t1"
#define BCRYPT_ECC_CURVE_BRAINPOOLP256R1 L"brainpoolP256r1"
#define BCRYPT_ECC_CURVE_BRAINPOOLP256T1 L"brainpoolP256t1"
#define BCRYPT_ECC_CURVE_BRAINPOOLP320R1 L"brainpoolP320r1"
#define BCRYPT_ECC_CURVE_BRAINPOOLP320T1 L"brainpoolP320t1"
#define BCRYPT_ECC_CURVE_BRAINPOOLP384R1 L"brainpoolP384r1"
#define BCRYPT_ECC_CURVE_BRAINPOOLP384T1 L"brainpoolP384t1"
#define BCRYPT_ECC_CURVE_BRAINPOOLP512R1 L"brainpoolP512r1"
#define BCRYPT_ECC_CURVE_BRAINPOOLP512T1 L"brainpoolP512t1"
#define BCRYPT_ECC_CURVE_25519 L"curve25519"
#define BCRYPT_ECC_CURVE_EC192WAPI L"ec192wapi"
#define BCRYPT_ECC_CURVE_NISTP192 L"nistP192"
#define BCRYPT_ECC_CURVE_NISTP224 L"nistP224"
#define BCRYPT_ECC_CURVE_NISTP256 L"nistP256"
#define BCRYPT_ECC_CURVE_NISTP384 L"nistP384"
#define BCRYPT_ECC_CURVE_NISTP521 L"nistP521"
#define BCRYPT_ECC_CURVE_NUMSP256T1 L"numsP256t1"
#define BCRYPT_ECC_CURVE_NUMSP384T1 L"numsP384t1"
#define BCRYPT_ECC_CURVE_NUMSP512T1 L"numsP512t1"
#define BCRYPT_ECC_CURVE_SECP160K1 L"secP160k1"
#define BCRYPT_ECC_CURVE_SECP160R1 L"secP160r1"
#define BCRYPT_ECC_CURVE_SECP160R2 L"secP160r2"
#define BCRYPT_ECC_CURVE_SECP192K1 L"secP192k1"
#define BCRYPT_ECC_CURVE_SECP192R1 L"secP192r1"
#define BCRYPT_ECC_CURVE_SECP224K1 L"secP224k1"
#define BCRYPT_ECC_CURVE_SECP224R1 L"secP224r1"
#define BCRYPT_ECC_CURVE_SECP256K1 L"secP256k1"
#define BCRYPT_ECC_CURVE_SECP256R1 L"secP256r1"
#define BCRYPT_ECC_CURVE_SECP384R1 L"secP384r1"
#define BCRYPT_ECC_CURVE_SECP521R1 L"secP521r1"
#define BCRYPT_ECC_CURVE_WTLS7 L"wtls7"
#define BCRYPT_ECC_CURVE_WTLS9 L"wtls9"
#define BCRYPT_ECC_CURVE_WTLS12 L"wtls12"
#define BCRYPT_ECC_CURVE_X962P192V1 L"x962P192v1"
#define BCRYPT_ECC_CURVE_X962P192V2 L"x962P192v2"
#define BCRYPT_ECC_CURVE_X962P192V3 L"x962P192v3"
#define BCRYPT_ECC_CURVE_X962P239V1 L"x962P239v1"
#define BCRYPT_ECC_CURVE_X962P239V2 L"x962P239v2"
#define BCRYPT_ECC_CURVE_X962P239V3 L"x962P239v3"
#define BCRYPT_ECC_CURVE_X962P256V1 L"x962P256v1"
#endif
typedef
enum
{
BCRYPT_HASH_OPERATION_HASH_DATA
=
1
,
BCRYPT_HASH_OPERATION_FINISH_HASH
=
2
,
}
BCRYPT_HASH_OPERATION_TYPE
;
typedef
struct
_BCRYPT_MULTI_HASH_OPERATION
{
;
BCRYPT_HASH_OPERATION_TYPE
;
_Field_size_(cbBuffer) PUCHAR pbBuffer; // data to be hashed, or result buffer
;
}
BCRYPT_MULTI_HASH_OPERATION
;
typedef
enum
{
BCRYPT_OPERATION_TYPE_HASH
=
1
,
}
BCRYPT_MULTI_OPERATION_TYPE
;
typedef
struct
_BCRYPT_MULTI_OBJECT_LENGTH_STRUCT
{
;
;
}
BCRYPT_MULTI_OBJECT_LENGTH_STRUCT
;
#define MS_PRIMITIVE_PROVIDER L"Microsoft Primitive Provider"
#define MS_PLATFORM_CRYPTO_PROVIDER L"Microsoft Platform Crypto Provider"
#define BCRYPT_RSA_ALGORITHM L"RSA"
#define BCRYPT_RSA_SIGN_ALGORITHM L"RSA_SIGN"
#define BCRYPT_DH_ALGORITHM L"DH"
#define BCRYPT_DSA_ALGORITHM L"DSA"
#define BCRYPT_RC2_ALGORITHM L"RC2"
#define BCRYPT_RC4_ALGORITHM L"RC4"
#define BCRYPT_AES_ALGORITHM L"AES"
#define BCRYPT_DES_ALGORITHM L"DES"
#define BCRYPT_DESX_ALGORITHM L"DESX"
#define BCRYPT_3DES_ALGORITHM L"3DES"
#define BCRYPT_3DES_112_ALGORITHM L"3DES_112"
#define BCRYPT_MD2_ALGORITHM L"MD2"
#define BCRYPT_MD4_ALGORITHM L"MD4"
#define BCRYPT_MD5_ALGORITHM L"MD5"
#define BCRYPT_SHA1_ALGORITHM L"SHA1"
#define BCRYPT_SHA256_ALGORITHM L"SHA256"
#define BCRYPT_SHA384_ALGORITHM L"SHA384"
#define BCRYPT_SHA512_ALGORITHM L"SHA512"
#define BCRYPT_AES_GMAC_ALGORITHM L"AES-GMAC"
#define BCRYPT_AES_CMAC_ALGORITHM L"AES-CMAC"
#define BCRYPT_ECDSA_P256_ALGORITHM L"ECDSA_P256"
#define BCRYPT_ECDSA_P384_ALGORITHM L"ECDSA_P384"
#define BCRYPT_ECDSA_P521_ALGORITHM L"ECDSA_P521"
#define BCRYPT_ECDH_P256_ALGORITHM L"ECDH_P256"
#define BCRYPT_ECDH_P384_ALGORITHM L"ECDH_P384"
#define BCRYPT_ECDH_P521_ALGORITHM L"ECDH_P521"
#define BCRYPT_RNG_ALGORITHM L"RNG"
#define BCRYPT_RNG_FIPS186_DSA_ALGORITHM L"FIPS186DSARNG"
#define BCRYPT_RNG_DUAL_EC_ALGORITHM L"DUALECRNG"
#if (NTDDI_VERSION >= NTDDI_WIN8)
#define BCRYPT_SP800108_CTR_HMAC_ALGORITHM L"SP800_108_CTR_HMAC"
#define BCRYPT_SP80056A_CONCAT_ALGORITHM L"SP800_56A_CONCAT"
#define BCRYPT_PBKDF2_ALGORITHM L"PBKDF2"
#define BCRYPT_CAPI_KDF_ALGORITHM L"CAPI_KDF"
#define BCRYPT_TLS1_1_KDF_ALGORITHM L"TLS1_1_KDF"
#define BCRYPT_TLS1_2_KDF_ALGORITHM L"TLS1_2_KDF"
#endif
#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
#define BCRYPT_ECDSA_ALGORITHM L"ECDSA"
#define BCRYPT_ECDH_ALGORITHM L"ECDH"
#define BCRYPT_XTS_AES_ALGORITHM L"XTS-AES"
#endif
#if (NTDDI_VERSION >= NTDDI_WIN10_RS4)
#define BCRYPT_HKDF_ALGORITHM L"HKDF"
#endif
#define BCRYPT_CIPHER_INTERFACE 0x00000001
#define BCRYPT_HASH_INTERFACE 0x00000002
#define BCRYPT_ASYMMETRIC_ENCRYPTION_INTERFACE 0x00000003
#define BCRYPT_SECRET_AGREEMENT_INTERFACE 0x00000004
#define BCRYPT_SIGNATURE_INTERFACE 0x00000005
#define BCRYPT_RNG_INTERFACE 0x00000006
#if (NTDDI_VERSION >= NTDDI_WIN8)
#define BCRYPT_KEY_DERIVATION_INTERFACE 0x00000007
#endif
#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
#define BCRYPT_MD2_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000001)
#define BCRYPT_MD4_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000011)
#define BCRYPT_MD5_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000021)
#define BCRYPT_SHA1_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000031)
#define BCRYPT_SHA256_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000041)
#define BCRYPT_SHA384_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000051)
#define BCRYPT_SHA512_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000061)
#define BCRYPT_RC4_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000071)
#define BCRYPT_RNG_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000081)
#define BCRYPT_HMAC_MD5_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000091)
#define BCRYPT_HMAC_SHA1_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x000000a1)
#define BCRYPT_HMAC_SHA256_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x000000b1)
#define BCRYPT_HMAC_SHA384_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x000000c1)
#define BCRYPT_HMAC_SHA512_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x000000d1)
#define BCRYPT_RSA_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x000000e1)
#define BCRYPT_ECDSA_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x000000f1)
#define BCRYPT_AES_CMAC_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000101)
#define BCRYPT_AES_GMAC_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000111)
#define BCRYPT_HMAC_MD2_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000121)
#define BCRYPT_HMAC_MD4_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000131)
#define BCRYPT_3DES_CBC_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000141)
#define BCRYPT_3DES_ECB_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000151)
#define BCRYPT_3DES_CFB_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000161)
#define BCRYPT_3DES_112_CBC_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000171)
#define BCRYPT_3DES_112_ECB_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000181)
#define BCRYPT_3DES_112_CFB_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000191)
#define BCRYPT_AES_CBC_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x000001a1)
#define BCRYPT_AES_ECB_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x000001b1)
#define BCRYPT_AES_CFB_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x000001c1)
#define BCRYPT_AES_CCM_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x000001d1)
#define BCRYPT_AES_GCM_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x000001e1)
#define BCRYPT_DES_CBC_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x000001f1)
#define BCRYPT_DES_ECB_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000201)
#define BCRYPT_DES_CFB_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000211)
#define BCRYPT_DESX_CBC_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000221)
#define BCRYPT_DESX_ECB_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000231)
#define BCRYPT_DESX_CFB_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000241)
#define BCRYPT_RC2_CBC_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000251)
#define BCRYPT_RC2_ECB_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000261)
#define BCRYPT_RC2_CFB_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000271)
#define BCRYPT_DH_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000281)
#define BCRYPT_ECDH_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000291)
#define BCRYPT_ECDH_P256_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x000002a1)
#define BCRYPT_ECDH_P384_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x000002b1)
#define BCRYPT_ECDH_P521_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x000002c1)
#define BCRYPT_DSA_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x000002d1)
#define BCRYPT_ECDSA_P256_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x000002e1)
#define BCRYPT_ECDSA_P384_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x000002f1)
#define BCRYPT_ECDSA_P521_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000301)
#define BCRYPT_RSA_SIGN_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000311)
#define BCRYPT_CAPI_KDF_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000321)
#define BCRYPT_PBKDF2_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000331)
#define BCRYPT_SP800108_CTR_HMAC_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000341)
#define BCRYPT_SP80056A_CONCAT_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000351)
#define BCRYPT_TLS1_1_KDF_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000361)
#define BCRYPT_TLS1_2_KDF_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000371)
#define BCRYPT_XTS_AES_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000381)
#define BCRYPT_HKDF_ALG_HANDLE ((BCRYPT_ALG_HANDLE) 0x00000391)
#endif
#define BCRYPT_ALG_HANDLE_HMAC_FLAG 0x00000008
#define BCRYPT_HASH_REUSABLE_FLAG 0x00000020
#if (NTDDI_VERSION >= NTDDI_WIN8)
#define BCRYPT_CAPI_AES_FLAG 0x00000010
#endif
#if (NTDDI_VERSION > NTDDI_WINBLUE || (NTDDI_VERSION == NTDDI_WINBLUE && defined(WINBLUE_KBSPRING14)))
#define BCRYPT_MULTI_FLAG 0x00000040
#endif
#define BCRYPT_BUFFERS_LOCKED_FLAG 0x00000040
#if (NTDDI_VERSION >= NTDDI_WINBLUE)
#define BCRYPT_EXTENDED_KEYSIZE 0x00000080
#endif
#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
#define BCRYPT_ENABLE_INCOMPATIBLE_FIPS_CHECKS 0x00000100
#endif
_Must_inspect_result_
BCryptOpenAlgorithmProvider
(
_Out_ BCRYPT_ALG_HANDLE *phAlgorithm,
_In_opt_ LPCWSTR pszImplementation,
#define BCRYPT_CIPHER_OPERATION 0x00000001
#define BCRYPT_HASH_OPERATION 0x00000002
#define BCRYPT_ASYMMETRIC_ENCRYPTION_OPERATION 0x00000004
#define BCRYPT_SECRET_AGREEMENT_OPERATION 0x00000008
#define BCRYPT_SIGNATURE_OPERATION 0x00000010
#define BCRYPT_RNG_OPERATION 0x00000020
#if (NTDDI_VERSION >= NTDDI_WIN8)
#define BCRYPT_KEY_DERIVATION_OPERATION 0x00000040
#endif
typedef
struct
_BCRYPT_ALGORITHM_IDENTIFIER
{
;
;
;
}
BCRYPT_ALGORITHM_IDENTIFIER
;
_Must_inspect_result_
(
_In_ ULONG dwAlgOperations,
_Out_ BCRYPT_ALGORITHM_IDENTIFIER **ppAlgList,
BCRYPT_ALGORITHM_IDENTIFIER
**
,
typedef
struct
{
;
}
;
_Must_inspect_result_
(
_Out_ BCRYPT_PROVIDER_NAME **ppImplList,
#define BCRYPT_PUBLIC_KEY_FLAG 0x00000001
#define BCRYPT_PRIVATE_KEY_FLAG 0x00000002
_Must_inspect_result_
(
_In_ BCRYPT_HANDLE hObject,
_In_ LPCWSTR pszProperty,
_Out_writes_bytes_to_opt_(cbOutput, *pcbResult) PUCHAR pbOutput,
_Must_inspect_result_
(
_Inout_ BCRYPT_HANDLE hObject,
_In_ LPCWSTR pszProperty,
_In_reads_bytes_(cbInput) PUCHAR pbInput,
BCryptCloseAlgorithmProvider
(
_Inout_ BCRYPT_ALG_HANDLE hAlgorithm,
(
_Must_inspect_result_
BCryptGenerateSymmetricKey
(
_Inout_ BCRYPT_ALG_HANDLE hAlgorithm,
_Out_ BCRYPT_KEY_HANDLE *phKey,
_Out_writes_bytes_all_opt_(cbKeyObject) PUCHAR pbKeyObject,
_In_reads_bytes_(cbSecret) PUCHAR pbSecret,
_Must_inspect_result_
(
_Inout_ BCRYPT_ALG_HANDLE hAlgorithm,
_Out_ BCRYPT_KEY_HANDLE *phKey,
_Must_inspect_result_
(
_Inout_ BCRYPT_KEY_HANDLE hKey,
_In_reads_bytes_opt_(cbInput) PUCHAR pbInput,
_In_opt_ VOID *pPaddingInfo,
_Inout_updates_bytes_opt_(cbIV) PUCHAR pbIV,
_Out_writes_bytes_to_opt_(cbOutput, *pcbResult) PUCHAR pbOutput,
_Must_inspect_result_
(
_Inout_ BCRYPT_KEY_HANDLE hKey,
_In_reads_bytes_opt_(cbInput) PUCHAR pbInput,
_In_opt_ VOID *pPaddingInfo,
_Inout_updates_bytes_opt_(cbIV) PUCHAR pbIV,
_Out_writes_bytes_to_opt_(cbOutput, *pcbResult) PUCHAR pbOutput,
_Must_inspect_result_
(
_In_ BCRYPT_KEY_HANDLE hKey,
_In_opt_ BCRYPT_KEY_HANDLE hExportKey,
_In_ LPCWSTR pszBlobType,
_Out_writes_bytes_to_opt_(cbOutput, *pcbResult) PUCHAR pbOutput,
_Must_inspect_result_
(
_In_ BCRYPT_ALG_HANDLE hAlgorithm,
_In_opt_ BCRYPT_KEY_HANDLE hImportKey,
_In_ LPCWSTR pszBlobType,
_Out_ BCRYPT_KEY_HANDLE *phKey,
_Out_writes_bytes_all_opt_(cbKeyObject) PUCHAR pbKeyObject,
_In_reads_bytes_(cbInput) PUCHAR pbInput,
#define BCRYPT_NO_KEY_VALIDATION 0x00000008
_Must_inspect_result_
(
_In_ BCRYPT_ALG_HANDLE hAlgorithm,
_In_opt_ BCRYPT_KEY_HANDLE hImportKey,
_In_ LPCWSTR pszBlobType,
_Out_ BCRYPT_KEY_HANDLE *phKey,
_In_reads_bytes_(cbInput) PUCHAR pbInput,
_Must_inspect_result_
(
_In_ BCRYPT_KEY_HANDLE hKey,
_Out_ BCRYPT_KEY_HANDLE *phNewKey,
_Out_writes_bytes_all_opt_(cbKeyObject) PUCHAR pbKeyObject,
_Must_inspect_result_
(
_Inout_ BCRYPT_KEY_HANDLE hKey,
(
_Inout_ BCRYPT_KEY_HANDLE hKey);
(
_Inout_ BCRYPT_SECRET_HANDLE hSecret);
_Must_inspect_result_
(
_In_ BCRYPT_KEY_HANDLE hKey,
_In_opt_ VOID *pPaddingInfo,
_In_reads_bytes_(cbInput) PUCHAR pbInput,
_Out_writes_bytes_to_opt_(cbOutput, *pcbResult) PUCHAR pbOutput,
_Must_inspect_result_
(
_In_ BCRYPT_KEY_HANDLE hKey,
_In_opt_ VOID *pPaddingInfo,
_In_reads_bytes_(cbHash) PUCHAR pbHash,
_In_reads_bytes_(cbSignature) PUCHAR pbSignature,
_Must_inspect_result_
(
_In_ BCRYPT_KEY_HANDLE hPrivKey,
_In_ BCRYPT_KEY_HANDLE hPubKey,
_Out_ BCRYPT_SECRET_HANDLE *phAgreedSecret,
_Must_inspect_result_
(
_In_ BCRYPT_SECRET_HANDLE hSharedSecret,
_In_opt_ BCryptBufferDesc *pParameterList,
_Out_writes_bytes_to_opt_(cbDerivedKey, *pcbResult) PUCHAR pbDerivedKey,
#if (NTDDI_VERSION >= NTDDI_WIN8)
_Must_inspect_result_
(
_In_ BCRYPT_KEY_HANDLE hKey,
_In_opt_ BCryptBufferDesc *pParameterList,
_Out_writes_bytes_to_(cbDerivedKey, *pcbResult) PUCHAR pbDerivedKey,
_In_ ULONG dwFlags);
#endif
_Must_inspect_result_
(
_Inout_ BCRYPT_ALG_HANDLE hAlgorithm,
_Out_ BCRYPT_HASH_HANDLE *phHash,
_Out_writes_bytes_all_opt_(cbHashObject) PUCHAR pbHashObject,
_In_reads_bytes_opt_(cbSecret) PUCHAR pbSecret, // optional
_In_ ULONG cbSecret, // optional
_Must_inspect_result_
(
_Inout_ BCRYPT_HASH_HANDLE hHash,
_In_reads_bytes_(cbInput) PUCHAR pbInput,
_Must_inspect_result_
(
_Inout_ BCRYPT_HASH_HANDLE hHash,
_Out_writes_bytes_all_(cbOutput) PUCHAR pbOutput,
#if (NTDDI_VERSION > NTDDI_WINBLUE || (NTDDI_VERSION == NTDDI_WINBLUE && defined(WINBLUE_KBSPRING14)))
_Must_inspect_result_
(
_Inout_ BCRYPT_ALG_HANDLE hAlgorithm,
_Out_ BCRYPT_HASH_HANDLE *phHash,
_Out_writes_bytes_all_opt_(cbHashObject) PUCHAR pbHashObject,
_In_reads_bytes_opt_(cbSecret) PUCHAR pbSecret, // optional
_In_ ULONG cbSecret, // optional
_Must_inspect_result_
BCryptProcessMultiOperations
(
_Inout_ BCRYPT_HANDLE hObject,
_In_ BCRYPT_MULTI_OPERATION_TYPE operationType,
BCRYPT_MULTI_OPERATION_TYPE
,
_In_reads_bytes_(cbOperations) PVOID pOperations,
_In_ ULONG dwFlags );
#endif
_Must_inspect_result_
(
_In_ BCRYPT_HASH_HANDLE hHash,
_Out_ BCRYPT_HASH_HANDLE *phNewHash,
_Out_writes_bytes_all_opt_(cbHashObject) PUCHAR pbHashObject,
(
_Inout_ BCRYPT_HASH_HANDLE hHash);
#if (NTDDI_VERSION >= NTDDI_WINTHRESHOLD)
(
_Inout_ BCRYPT_ALG_HANDLE hAlgorithm,
_In_reads_bytes_opt_(cbSecret) PUCHAR pbSecret, // for keyed algs
_In_ ULONG cbSecret, // for keyed algs
_In_reads_bytes_(cbInput) PUCHAR pbInput,
_Out_writes_bytes_all_(cbOutput) PUCHAR pbOutput,
_In_ ULONG cbOutput );
#endif
#define BCRYPT_RNG_USE_ENTROPY_IN_BUFFER 0x00000001
#define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002
_Must_inspect_result_
(
_In_opt_ BCRYPT_ALG_HANDLE hAlgorithm,
_Out_writes_bytes_(cbBuffer) PUCHAR pbBuffer,
#if (NTDDI_VERSION >= NTDDI_WIN7)
_Must_inspect_result_
(
_In_ BCRYPT_HASH_HANDLE hHash,
_In_opt_ BCRYPT_ALG_HANDLE hTargetAlg,
_Out_writes_bytes_( cbDerivedKey ) PUCHAR pbDerivedKey,
_In_ ULONG dwFlags);
#endif
#if (NTDDI_VERSION >= NTDDI_WIN7)
_Must_inspect_result_
(
_In_ BCRYPT_ALG_HANDLE hPrf,
_In_reads_bytes_opt_( cbPassword ) PUCHAR pbPassword,
_In_reads_bytes_opt_( cbSalt ) PUCHAR pbSalt,
_In_ ULONGLONG cIterations,
_Out_writes_bytes_( cbDerivedKey ) PUCHAR pbDerivedKey,
_In_ ULONG dwFlags);
#endif
typedef
struct
_BCRYPT_INTERFACE_VERSION
{
;
;
}
, *
PBCRYPT_INTERFACE_VERSION
;
#define BCRYPT_MAKE_INTERFACE_VERSION(major,minor) {(USHORT)major, (USHORT)minor}
#define BCRYPT_IS_INTERFACE_VERSION_COMPATIBLE(loader, provider) \
((loader).MajorVersion <= (provider).MajorVersion)
#define BCRYPT_CIPHER_INTERFACE_VERSION_1 BCRYPT_MAKE_INTERFACE_VERSION(1,0)
#define BCRYPT_HASH_INTERFACE_VERSION_1 BCRYPT_MAKE_INTERFACE_VERSION(1,0)
#if (NTDDI_VERSION > NTDDI_WINBLUE || (NTDDI_VERSION == NTDDI_WINBLUE && defined(WINBLUE_KBSPRING14)))
#define BCRYPT_HASH_INTERFACE_MAJORVERSION_2 2
#define BCRYPT_HASH_INTERFACE_VERSION_2 BCRYPT_MAKE_INTERFACE_VERSION(BCRYPT_HASH_INTERFACE_MAJORVERSION_2,0)
#endif
#define BCRYPT_ASYMMETRIC_ENCRYPTION_INTERFACE_VERSION_1 BCRYPT_MAKE_INTERFACE_VERSION(1,0)
#define BCRYPT_SECRET_AGREEMENT_INTERFACE_VERSION_1 BCRYPT_MAKE_INTERFACE_VERSION(1,0)
#define BCRYPT_SIGNATURE_INTERFACE_VERSION_1 BCRYPT_MAKE_INTERFACE_VERSION(1,0)
#define BCRYPT_RNG_INTERFACE_VERSION_1 BCRYPT_MAKE_INTERFACE_VERSION(1,0)
#define CRYPT_MIN_DEPENDENCIES (0x00000001)
#define CRYPT_PROCESS_ISOLATE (0x00010000) // User-mode only
#define CRYPT_UM (0x00000001) // User mode only
#define CRYPT_KM (0x00000002) // Kernel mode only
#define CRYPT_MM (0x00000003) // Multi-mode: Must support BOTH UM and KM
#define CRYPT_ANY (0x00000004) // Wildcard: Either UM, or KM, or both
#define CRYPT_OVERWRITE (0x00000001)
#define CRYPT_LOCAL (0x00000001)
#define CRYPT_DOMAIN (0x00000002)
#define CRYPT_EXCLUSIVE (0x00000001)
#define CRYPT_OVERRIDE (0x00010000) // Enterprise table only
#define CRYPT_ALL_FUNCTIONS (0x00000001)
#define CRYPT_ALL_PROVIDERS (0x00000002)
#define CRYPT_PRIORITY_TOP (0x00000000)
#define CRYPT_PRIORITY_BOTTOM (0xFFFFFFFF)
#define CRYPT_DEFAULT_CONTEXT L"Default"
typedef
struct
{
;
;
;
*
;
}
, *
;
typedef
struct
{
;
;
*
;
}
, *
;
typedef
struct
{
;
*
;
;
;
}
, *
;
typedef
struct
{
;
*
;
}
, *
;
typedef
struct
{
;
;
}
, *
;
typedef
struct
_CRYPT_CONTEXT_FUNCTION_CONFIG
{
;
;
}
CRYPT_CONTEXT_FUNCTION_CONFIG
, *
PCRYPT_CONTEXT_FUNCTION_CONFIG
;
typedef
struct
{
;
*
;
}
, *
;
typedef
struct
{
;
*
;
}
, *
;
typedef
struct
_CRYPT_CONTEXT_FUNCTION_PROVIDERS
{
;
*
;
}
CRYPT_CONTEXT_FUNCTION_PROVIDERS
, *
PCRYPT_CONTEXT_FUNCTION_PROVIDERS
;
typedef
struct
{
;
;
;
}
, *
;
typedef
struct
{
;
;
}
, *
;
typedef
struct
{
;
;
;
;
*
;
;
;
}
, *
;
typedef
struct
{
;
*
;
}
, *
;
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
#pragma endregion
#pragma region Desktop Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
#ifndef KERNEL_MODE_CNG
_Must_inspect_result_
BCryptQueryProviderRegistration
(
_In_ LPCWSTR pszProvider,
_Inout_ ULONG* pcbBuffer,
_Inout_
_When_(_Old_(*ppBuffer) != NULL, _At_(*ppBuffer, _Out_writes_bytes_to_(*pcbBuffer, *pcbBuffer)))
_When_(_Old_(*ppBuffer) == NULL, _Outptr_result_bytebuffer_all_(*pcbBuffer))
*
);
_Must_inspect_result_
BCryptEnumRegisteredProviders
(
_Inout_ ULONG* pcbBuffer,
_Inout_
_When_(_Old_(*ppBuffer) != NULL, _At_(*ppBuffer, _Out_writes_bytes_to_(*pcbBuffer, *pcbBuffer)))
_When_(_Old_(*ppBuffer) == NULL, _Outptr_result_bytebuffer_all_(*pcbBuffer))
*
);
_Must_inspect_result_
(
_In_opt_ PCRYPT_CONTEXT_CONFIG pConfig); // Optional
_Must_inspect_result_
(
_In_ LPCWSTR pszContext);
_Must_inspect_result_
(
_Inout_ ULONG* pcbBuffer,
_Inout_
_When_(_Old_(*ppBuffer) != NULL, _At_(*ppBuffer, _Out_writes_bytes_to_(*pcbBuffer, *pcbBuffer)))
_When_(_Old_(*ppBuffer) == NULL, _Outptr_result_bytebuffer_all_(*pcbBuffer))
*
);
_Must_inspect_result_
(
_In_ PCRYPT_CONTEXT_CONFIG pConfig);
_Must_inspect_result_
BCryptQueryContextConfiguration
(
_Inout_ ULONG* pcbBuffer,
_Inout_
_When_(_Old_(*ppBuffer) != NULL, _At_(*ppBuffer, _Out_writes_bytes_to_(*pcbBuffer, *pcbBuffer)))
_When_(_Old_(*ppBuffer) == NULL, _Outptr_result_bytebuffer_all_(*pcbBuffer))
*
);
_Must_inspect_result_
(
_In_ LPCWSTR pszFunction,
_Must_inspect_result_
BCryptRemoveContextFunction
(
_In_ LPCWSTR pszFunction);
_Must_inspect_result_
BCryptEnumContextFunctions
(
_Inout_ ULONG* pcbBuffer,
_Inout_
_When_(_Old_(*ppBuffer) != NULL, _At_(*ppBuffer, _Out_writes_bytes_to_(*pcbBuffer, *pcbBuffer)))
_When_(_Old_(*ppBuffer) == NULL, _Outptr_result_bytebuffer_all_(*pcbBuffer))
*
);
_Must_inspect_result_
BCryptConfigureContextFunction
(
_In_ LPCWSTR pszFunction,
_In_ PCRYPT_CONTEXT_FUNCTION_CONFIG pConfig);
PCRYPT_CONTEXT_FUNCTION_CONFIG
);
_Must_inspect_result_
BCryptQueryContextFunctionConfiguration
(
_In_ LPCWSTR pszFunction,
_Inout_ ULONG* pcbBuffer,
_Inout_
_When_(_Old_(*ppBuffer) != NULL, _At_(*ppBuffer, _Out_writes_bytes_to_(*pcbBuffer, *pcbBuffer)))
_When_(_Old_(*ppBuffer) == NULL, _Outptr_result_bytebuffer_all_(*pcbBuffer))
PCRYPT_CONTEXT_FUNCTION_CONFIG
*
);
_Must_inspect_result_
BCryptEnumContextFunctionProviders
(
_In_ LPCWSTR pszFunction,
_Inout_ ULONG* pcbBuffer,
_Inout_
_When_(_Old_(*ppBuffer) != NULL, _At_(*ppBuffer, _Out_writes_bytes_to_(*pcbBuffer, *pcbBuffer)))
_When_(_Old_(*ppBuffer) == NULL, _Outptr_result_bytebuffer_all_(*pcbBuffer))
PCRYPT_CONTEXT_FUNCTION_PROVIDERS
*
);
_Must_inspect_result_
BCryptSetContextFunctionProperty
(
_In_ LPCWSTR pszFunction,
_In_ LPCWSTR pszProperty,
_In_reads_bytes_opt_(cbValue) PUCHAR pbValue);
_Must_inspect_result_
BCryptQueryContextFunctionProperty
(
_In_ LPCWSTR pszFunction,
_In_ LPCWSTR pszProperty,
_Inout_
_When_(_Old_(*ppbValue) != NULL, _At_(*ppbValue, _Out_writes_bytes_to_(*pcbValue, *pcbValue)))
_When_(_Old_(*ppbValue) == NULL, _Outptr_result_bytebuffer_all_(*pcbValue))
*
);
#endif //#ifndef KERNEL_MODE_CNG
#ifdef KERNEL_MODE_CNG
_Must_inspect_result_
NTSTATUS
WINAPI
BCryptRegisterConfigChangeNotify(
_In_ PRKEVENT pEvent);
#else
_Must_inspect_result_
BCryptRegisterConfigChangeNotify
(
_Out_ HANDLE *phEvent);
#endif
#ifdef KERNEL_MODE_CNG
NTSTATUS
WINAPI
BCryptUnregisterConfigChangeNotify(
_In_ PRKEVENT pEvent);
#else
BCryptUnregisterConfigChangeNotify
(
_In_ HANDLE hEvent);
#endif
_Must_inspect_result_
(
_In_opt_ LPCWSTR pszContext,
_In_opt_ ULONG dwInterface,
_In_opt_ LPCWSTR pszFunction,
_In_opt_ LPCWSTR pszProvider,
_Inout_ ULONG* pcbBuffer,
_Inout_
_When_(_Old_(*ppBuffer) != NULL, _At_(*ppBuffer, _Out_writes_bytes_to_(*pcbBuffer, *pcbBuffer)))
_When_(_Old_(*ppBuffer) == NULL, _Outptr_result_bytebuffer_all_(*pcbBuffer))
*
);
#endif /* WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM */
#pragma endregion
#pragma region Application Family or OneCore Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
BCryptGetFipsAlgorithmMode
(
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)*/
#pragma endregion
#pragma region Desktop Family
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
(
);
#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */
#pragma endregion
#ifdef __cplusplus
}
#endif
#if _MSC_VER >= 1200
#pragma warning(pop)
#endif