| bcrypt.h (6.1.7600.16385-Windows_7.0) | | bcrypt.h (6.3.9600.17415-Windows_8.1) |
| | |
| skipping to change at line 15 | | skipping to change at line 15 |
| // | | // |
| // File: bcrypt.h | | // File: bcrypt.h |
| // | | // |
| // Contents: Cryptographic Primitive API Prototypes and Definitions | | // Contents: Cryptographic Primitive API Prototypes and Definitions |
| // | | // |
| //---------------------------------------------------------------------------- | | //---------------------------------------------------------------------------- |
| | |
| #ifndef __BCRYPT_H__ | | #ifndef __BCRYPT_H__ |
| #define __BCRYPT_H__ | | #define __BCRYPT_H__ |
| | |
|
| | #include <winapifamily.h> |
| | |
| #ifdef __cplusplus | | #ifdef __cplusplus |
| extern "C" { | | extern "C" { |
| #endif | | #endif |
| | |
|
| | #pragma region Desktop Family |
| | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) |
| | |
| #ifndef WINAPI | | #ifndef WINAPI |
| #define WINAPI __stdcall | | #define WINAPI __stdcall |
| #endif | | #endif |
| | |
| #ifndef _NTDEF_ | | #ifndef _NTDEF_ |
|
| typedef __success(return >= 0) LONG NTSTATUS; | | typedef _Return_type_success_(return >= 0) LONG NTSTATUS; |
| typedef NTSTATUS *PNTSTATUS; | | typedef NTSTATUS *PNTSTATUS; |
| #endif | | #endif |
| | |
| #ifndef BCRYPT_SUCCESS | | #ifndef BCRYPT_SUCCESS |
| #define BCRYPT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0) | | #define BCRYPT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0) |
| #endif | | #endif |
| | |
| #ifndef CONST | | #ifndef CONST |
| #define CONST const | | #define CONST const |
| #endif | | #endif |
| | |
| skipping to change at line 96 | | skipping to change at line 101 |
| #define KDF_HMAC_KEY 0x3 | | #define KDF_HMAC_KEY 0x3 |
| #define KDF_TLS_PRF_LABEL 0x4 | | #define KDF_TLS_PRF_LABEL 0x4 |
| #define KDF_TLS_PRF_SEED 0x5 | | #define KDF_TLS_PRF_SEED 0x5 |
| #define KDF_SECRET_HANDLE 0x6 | | #define KDF_SECRET_HANDLE 0x6 |
| #define KDF_TLS_PRF_PROTOCOL 0x7 | | #define KDF_TLS_PRF_PROTOCOL 0x7 |
| #define KDF_ALGORITHMID 0x8 | | #define KDF_ALGORITHMID 0x8 |
| #define KDF_PARTYUINFO 0x9 | | #define KDF_PARTYUINFO 0x9 |
| #define KDF_PARTYVINFO 0xA | | #define KDF_PARTYVINFO 0xA |
| #define KDF_SUPPPUBINFO 0xB | | #define KDF_SUPPPUBINFO 0xB |
| #define KDF_SUPPPRIVINFO 0xC | | #define KDF_SUPPPRIVINFO 0xC |
|
| | #define KDF_LABEL 0xD |
| | #define KDF_CONTEXT 0xE |
| | #define KDF_SALT 0xF |
| | #define KDF_ITERATION_COUNT 0x10 |
| | // |
| | // |
| | // Parameters for BCrypt(/NCrypt)KeyDerivation: |
| | // Generic parameters: |
| | // KDF_GENERIC_PARAMETER and KDF_HASH_ALGORITHM are the generic parameters that |
| | can be passed for the following KDF algorithms: |
| | // BCRYPT/NCRYPT_SP800108_CTR_HMAC_ALGORITHM |
| | // KDF_GENERIC_PARAMETER = KDF_LABEL||0x00||KDF_CONTEXT |
| | // BCRYPT/NCRYPT_SP80056A_CONCAT_ALGORITHM |
| | // KDF_GENERIC_PARAMETER = KDF_ALGORITHMID || KDF_PARTYUINFO || KDF_PARTYVI |
| | NFO {|| KDF_SUPPPUBINFO } {|| KDF_SUPPPRIVINFO } |
| | // BCRYPT/NCRYPT_PBKDF2_ALGORITHM |
| | // KDF_GENERIC_PARAMETER = KDF_SALT |
| | // BCRYPT/NCRYPT_CAPI_KDF_ALGORITHM |
| | // KDF_GENERIC_PARAMETER = Not used |
| | // |
| | // KDF specific parameters: |
| | // For BCRYPT/NCRYPT_SP800108_CTR_HMAC_ALGORITHM: |
| | // KDF_HASH_ALGORITHM, KDF_LABEL and KDF_CONTEXT are required |
| | // For BCRYPT/NCRYPT_SP80056A_CONCAT_ALGORITHM: |
| | // KDF_HASH_ALGORITHM, KDF_ALGORITHMID, KDF_PARTYUINFO, KDF_PARTYVINFO are |
| | required |
| | // KDF_SUPPPUBINFO, KDF_SUPPPRIVINFO are optional |
| | // For BCRYPT/NCRYPT_PBKDF2_ALGORITHM |
| | // KDF_HASH_ALGORITHM is required |
| | // KDF_ITERATION_COUNT, KDF_SALT are optional |
| | // Iteration count, (if not specified) will default to 10,000 |
| | // For BCRYPT/NCRYPT_CAPI_KDF_ALGORITHM |
| | // KDF_HASH_ALGORITHM is required |
| | // |
| | #define KDF_GENERIC_PARAMETER 0x11 |
| | |
| | #define KDF_KEYBITLENGTH 0x12 |
| | |
| // | | // |
| // DeriveKey Flags: | | // DeriveKey Flags: |
| // | | // |
| // KDF_USE_SECRET_AS_HMAC_KEY_FLAG causes the secret agreement to serve also | | // KDF_USE_SECRET_AS_HMAC_KEY_FLAG causes the secret agreement to serve also |
| // as the HMAC key. If this flag is used, the KDF_HMAC_KEY parameter should | | // as the HMAC key. If this flag is used, the KDF_HMAC_KEY parameter should |
| // NOT be specified. | | // NOT be specified. |
| // | | // |
| #define KDF_USE_SECRET_AS_HMAC_KEY_FLAG 0x1 | | #define KDF_USE_SECRET_AS_HMAC_KEY_FLAG 0x1 |
| | |
| | |
| skipping to change at line 205 | | skipping to change at line 244 |
| #define BCRYPT_BLOCK_SIZE_LIST L"BlockSizeList" | | #define BCRYPT_BLOCK_SIZE_LIST L"BlockSizeList" |
| #define BCRYPT_EFFECTIVE_KEY_LENGTH L"EffectiveKeyLength" | | #define BCRYPT_EFFECTIVE_KEY_LENGTH L"EffectiveKeyLength" |
| #define BCRYPT_HASH_LENGTH L"HashDigestLength" | | #define BCRYPT_HASH_LENGTH L"HashDigestLength" |
| #define BCRYPT_HASH_OID_LIST L"HashOIDList" | | #define BCRYPT_HASH_OID_LIST L"HashOIDList" |
| #define BCRYPT_PADDING_SCHEMES L"PaddingSchemes" | | #define BCRYPT_PADDING_SCHEMES L"PaddingSchemes" |
| #define BCRYPT_SIGNATURE_LENGTH L"SignatureLength" | | #define BCRYPT_SIGNATURE_LENGTH L"SignatureLength" |
| #define BCRYPT_HASH_BLOCK_LENGTH L"HashBlockLength" | | #define BCRYPT_HASH_BLOCK_LENGTH L"HashBlockLength" |
| #define BCRYPT_AUTH_TAG_LENGTH L"AuthTagLength" | | #define BCRYPT_AUTH_TAG_LENGTH L"AuthTagLength" |
| #define BCRYPT_PRIMITIVE_TYPE L"PrimitiveType" | | #define BCRYPT_PRIMITIVE_TYPE L"PrimitiveType" |
| #define BCRYPT_IS_KEYED_HASH L"IsKeyedHash" | | #define BCRYPT_IS_KEYED_HASH L"IsKeyedHash" |
|
| | #define BCRYPT_IS_REUSABLE_HASH L"IsReusableHash" |
| | #define BCRYPT_MESSAGE_BLOCK_LENGTH L"MessageBlockLength" |
| | |
| | // Additional BCryptGetProperty strings for the RNG Platform Crypto Provider |
| | #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 |
| | |
| // BCryptSetProperty strings | | // BCryptSetProperty strings |
| #define BCRYPT_INITIALIZATION_VECTOR L"IV" | | #define BCRYPT_INITIALIZATION_VECTOR L"IV" |
| | |
| // Property Strings | | // Property Strings |
| #define BCRYPT_CHAIN_MODE_NA L"ChainingModeN/A" | | #define BCRYPT_CHAIN_MODE_NA L"ChainingModeN/A" |
| #define BCRYPT_CHAIN_MODE_CBC L"ChainingModeCBC" | | #define BCRYPT_CHAIN_MODE_CBC L"ChainingModeCBC" |
| #define BCRYPT_CHAIN_MODE_ECB L"ChainingModeECB" | | #define BCRYPT_CHAIN_MODE_ECB L"ChainingModeECB" |
| #define BCRYPT_CHAIN_MODE_CFB L"ChainingModeCFB" | | #define BCRYPT_CHAIN_MODE_CFB L"ChainingModeCFB" |
| #define BCRYPT_CHAIN_MODE_CCM L"ChainingModeCCM" | | #define BCRYPT_CHAIN_MODE_CCM L"ChainingModeCCM" |
| | |
| skipping to change at line 237 | | skipping to change at line 286 |
| | |
| #define BCRYPT_PROV_DISPATCH 0x00000001 // BCryptOpenAlgorithmProvider | | #define BCRYPT_PROV_DISPATCH 0x00000001 // BCryptOpenAlgorithmProvider |
| | |
| #define BCRYPT_BLOCK_PADDING 0x00000001 // BCryptEncrypt/Decrypt | | #define BCRYPT_BLOCK_PADDING 0x00000001 // BCryptEncrypt/Decrypt |
| | |
| // RSA padding schemes | | // RSA padding schemes |
| #define BCRYPT_PAD_NONE 0x00000001 | | #define BCRYPT_PAD_NONE 0x00000001 |
| #define BCRYPT_PAD_PKCS1 0x00000002 // BCryptEncrypt/Decrypt BCryptS
ignHash/VerifySignature | | #define BCRYPT_PAD_PKCS1 0x00000002 // BCryptEncrypt/Decrypt BCryptS
ignHash/VerifySignature |
| #define BCRYPT_PAD_OAEP 0x00000004 // BCryptEncrypt/Decrypt | | #define BCRYPT_PAD_OAEP 0x00000004 // BCryptEncrypt/Decrypt |
| #define BCRYPT_PAD_PSS 0x00000008 // BCryptSignHash/VerifySignatur
e | | #define BCRYPT_PAD_PSS 0x00000008 // BCryptSignHash/VerifySignatur
e |
|
| | #if (NTDDI_VERSION >= NTDDI_WINBLUE) |
| | #define BCRYPT_PAD_PKCS1_OPTIONAL_HASH_OID 0x00000010 //BCryptVerifySignature |
| | #endif |
| | |
| #define BCRYPTBUFFER_VERSION 0 | | #define BCRYPTBUFFER_VERSION 0 |
| | |
|
| | #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */ |
| | #pragma endregion |
| | |
| | #pragma region Application Family |
| | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) |
| | |
| typedef struct _BCryptBuffer { | | typedef struct _BCryptBuffer { |
| ULONG cbBuffer; // Length of buffer, in bytes | | ULONG cbBuffer; // Length of buffer, in bytes |
| ULONG BufferType; // Buffer type | | ULONG BufferType; // Buffer type |
| PVOID pvBuffer; // Pointer to buffer | | PVOID pvBuffer; // Pointer to buffer |
| } BCryptBuffer, * PBCryptBuffer; | | } BCryptBuffer, * PBCryptBuffer; |
| | |
| typedef struct _BCryptBufferDesc { | | typedef struct _BCryptBufferDesc { |
| ULONG ulVersion; // Version number | | ULONG ulVersion; // Version number |
| ULONG cBuffers; // Number of buffers | | ULONG cBuffers; // Number of buffers |
| PBCryptBuffer pBuffers; // Pointer to array of buffers | | PBCryptBuffer pBuffers; // Pointer to array of buffers |
| } BCryptBufferDesc, * PBCryptBufferDesc; | | } BCryptBufferDesc, * PBCryptBufferDesc; |
| | |
|
| | #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */ |
| | #pragma endregion |
| | |
| | #pragma region Desktop Family |
| | #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) |
| | |
| // | | // |
| // Primitive handles | | // Primitive handles |
| // | | // |
| | |
| typedef PVOID BCRYPT_HANDLE; | | typedef PVOID BCRYPT_HANDLE; |
| typedef PVOID BCRYPT_ALG_HANDLE; | | typedef PVOID BCRYPT_ALG_HANDLE; |
| typedef PVOID BCRYPT_KEY_HANDLE; | | typedef PVOID BCRYPT_KEY_HANDLE; |
| typedef PVOID BCRYPT_HASH_HANDLE; | | typedef PVOID BCRYPT_HASH_HANDLE; |
| typedef PVOID BCRYPT_SECRET_HANDLE; | | typedef PVOID BCRYPT_SECRET_HANDLE; |
| | |
| | |
| skipping to change at line 315 | | skipping to change at line 379 |
| // Prime1 | | // Prime1 |
| // Prime2 | | // Prime2 |
| // Private Exponent mod (Prime1 - 1) | | // Private Exponent mod (Prime1 - 1) |
| // Private Exponent mod (Prime2 - 1) | | // Private Exponent mod (Prime2 - 1) |
| // Inverse of Prime2 mod Prime1 | | // Inverse of Prime2 mod Prime1 |
| // PrivateExponent | | // PrivateExponent |
| #define BCRYPT_RSAFULLPRIVATE_BLOB L"RSAFULLPRIVATEBLOB" | | #define BCRYPT_RSAFULLPRIVATE_BLOB L"RSAFULLPRIVATEBLOB" |
| | |
| #define BCRYPT_RSAFULLPRIVATE_MAGIC 0x33415352 // RSA3 | | #define BCRYPT_RSAFULLPRIVATE_MAGIC 0x33415352 // RSA3 |
| | |
|
| | //Properties of secret agreement algorithms |
| | #define BCRYPT_GLOBAL_PARAMETERS L"SecretAgreementParam" |
| | #define BCRYPT_PRIVATE_KEY L"PrivKeyVal" |
| | |
| // The BCRYPT_ECCPUBLIC_BLOB and BCRYPT_ECCPRIVATE_BLOB blob types are used | | // The BCRYPT_ECCPUBLIC_BLOB and BCRYPT_ECCPRIVATE_BLOB blob types are used |
| // to transport plaintext ECC keys. These blob types will be supported by | | // to transport plaintext ECC keys. These blob types will be supported by |
| // all ECC primitive providers. | | // all ECC primitive providers. |
| #define BCRYPT_ECCPUBLIC_BLOB L"ECCPUBLICBLOB" | | #define BCRYPT_ECCPUBLIC_BLOB L"ECCPUBLICBLOB" |
| #define BCRYPT_ECCPRIVATE_BLOB L"ECCPRIVATEBLOB" | | #define BCRYPT_ECCPRIVATE_BLOB L"ECCPRIVATEBLOB" |
| | |
| #define BCRYPT_ECDH_PUBLIC_P256_MAGIC 0x314B4345 // ECK1 | | #define BCRYPT_ECDH_PUBLIC_P256_MAGIC 0x314B4345 // ECK1 |
| #define BCRYPT_ECDH_PRIVATE_P256_MAGIC 0x324B4345 // ECK2 | | #define BCRYPT_ECDH_PRIVATE_P256_MAGIC 0x324B4345 // ECK2 |
| #define BCRYPT_ECDH_PUBLIC_P384_MAGIC 0x334B4345 // ECK3 | | #define BCRYPT_ECDH_PUBLIC_P384_MAGIC 0x334B4345 // ECK3 |
| #define BCRYPT_ECDH_PRIVATE_P384_MAGIC 0x344B4345 // ECK4 | | #define BCRYPT_ECDH_PRIVATE_P384_MAGIC 0x344B4345 // ECK4 |
| | |
| skipping to change at line 363 | | skipping to change at line 431 |
| { | | { |
| ULONG dwMagic; | | ULONG dwMagic; |
| ULONG cbKey; | | ULONG cbKey; |
| } BCRYPT_DH_KEY_BLOB, *PBCRYPT_DH_KEY_BLOB; | | } BCRYPT_DH_KEY_BLOB, *PBCRYPT_DH_KEY_BLOB; |
| | |
| // Property Strings for DH | | // Property Strings for DH |
| #define BCRYPT_DH_PARAMETERS L"DHParameters" | | #define BCRYPT_DH_PARAMETERS L"DHParameters" |
| | |
| #define BCRYPT_DH_PARAMETERS_MAGIC 0x4d504844 // DHPM | | #define BCRYPT_DH_PARAMETERS_MAGIC 0x4d504844 // DHPM |
| | |
|
| typedef __struct_bcount(cbLength) struct _BCRYPT_DH_PARAMETER_HEADER | | typedef _Struct_size_bytes_(cbLength) struct _BCRYPT_DH_PARAMETER_HEADER |
| { | | { |
| ULONG cbLength; | | ULONG cbLength; |
| ULONG dwMagic; | | ULONG dwMagic; |
| ULONG cbKeyLength; | | ULONG cbKeyLength; |
| } BCRYPT_DH_PARAMETER_HEADER; | | } BCRYPT_DH_PARAMETER_HEADER; |
| | |
| // The BCRYPT_DSA_PUBLIC_BLOB and BCRYPT_DSA_PRIVATE_BLOB blob types are used | | // The BCRYPT_DSA_PUBLIC_BLOB and BCRYPT_DSA_PRIVATE_BLOB blob types are used |
| // to transport plaintext DSA keys. These blob types will be supported by | | // to transport plaintext DSA keys. These blob types will be supported by |
| // all DSA primitive providers. | | // all DSA primitive providers. |
| #define BCRYPT_DSA_PUBLIC_BLOB L"DSAPUBLICBLOB" | | #define BCRYPT_DSA_PUBLIC_BLOB L"DSAPUBLICBLOB" |
| #define BCRYPT_DSA_PRIVATE_BLOB L"DSAPRIVATEBLOB" | | #define BCRYPT_DSA_PRIVATE_BLOB L"DSAPRIVATEBLOB" |
| #define LEGACY_DSA_PUBLIC_BLOB L"CAPIDSAPUBLICBLOB" | | #define LEGACY_DSA_PUBLIC_BLOB L"CAPIDSAPUBLICBLOB" |
| #define LEGACY_DSA_PRIVATE_BLOB L"CAPIDSAPRIVATEBLOB" | | #define LEGACY_DSA_PRIVATE_BLOB L"CAPIDSAPRIVATEBLOB" |
| #define LEGACY_DSA_V2_PUBLIC_BLOB L"V2CAPIDSAPUBLICBLOB" | | #define LEGACY_DSA_V2_PUBLIC_BLOB L"V2CAPIDSAPUBLICBLOB" |
| #define LEGACY_DSA_V2_PRIVATE_BLOB L"V2CAPIDSAPRIVATEBLOB" | | #define LEGACY_DSA_V2_PRIVATE_BLOB L"V2CAPIDSAPRIVATEBLOB" |
| | |
|
| #define BCRYPT_DSA_PUBLIC_MAGIC 0x42505344 // DSPB | | #define BCRYPT_DSA_PUBLIC_MAGIC 0x42505344 // DSPB |
| #define BCRYPT_DSA_PRIVATE_MAGIC 0x56505344 // DSPV | | #define BCRYPT_DSA_PRIVATE_MAGIC 0x56505344 // DSPV |
| | #define BCRYPT_DSA_PUBLIC_MAGIC_V2 0x32425044 // DPB2 |
| | #define BCRYPT_DSA_PRIVATE_MAGIC_V2 0x32565044 // DPV2 |
| | |
| typedef struct _BCRYPT_DSA_KEY_BLOB | | typedef struct _BCRYPT_DSA_KEY_BLOB |
| { | | { |
| ULONG dwMagic; | | ULONG dwMagic; |
| ULONG cbKey; | | ULONG cbKey; |
| UCHAR Count[4]; | | UCHAR Count[4]; |
| UCHAR Seed[20]; | | UCHAR Seed[20]; |
| UCHAR q[20]; | | UCHAR q[20]; |
| } BCRYPT_DSA_KEY_BLOB, *PBCRYPT_DSA_KEY_BLOB; | | } BCRYPT_DSA_KEY_BLOB, *PBCRYPT_DSA_KEY_BLOB; |
| | |
|
| | typedef enum |
| | { |
| | DSA_HASH_ALGORITHM_SHA1, |
| | DSA_HASH_ALGORITHM_SHA256, |
| | DSA_HASH_ALGORITHM_SHA512 |
| | }HASHALGORITHM_ENUM; |
| | |
| | typedef enum |
| | { |
| | DSA_FIPS186_2, |
| | DSA_FIPS186_3 |
| | } DSAFIPSVERSION_ENUM; |
| | |
| | typedef struct _BCRYPT_DSA_KEY_BLOB_V2 |
| | { |
| | ULONG dwMagic; |
| | ULONG cbKey; |
| | HASHALGORITHM_ENUM hashAlgorithm; |
| | DSAFIPSVERSION_ENUM standardVersion; |
| | ULONG cbSeedLength; |
| | ULONG cbGroupSize; |
| | UCHAR Count[4]; |
| | } BCRYPT_DSA_KEY_BLOB_V2, *PBCRYPT_DSA_KEY_BLOB_V2; |
| | |
| typedef struct _BCRYPT_KEY_DATA_BLOB_HEADER | | typedef struct _BCRYPT_KEY_DATA_BLOB_HEADER |
| { | | { |
| ULONG dwMagic; | | ULONG dwMagic; |
| ULONG dwVersion; | | ULONG dwVersion; |
| ULONG cbKeyData; | | ULONG cbKeyData; |
| } BCRYPT_KEY_DATA_BLOB_HEADER, *PBCRYPT_KEY_DATA_BLOB_HEADER; | | } BCRYPT_KEY_DATA_BLOB_HEADER, *PBCRYPT_KEY_DATA_BLOB_HEADER; |
| | |
| #define BCRYPT_KEY_DATA_BLOB_MAGIC 0x4d42444b //Key Data Blob Magic (KDBM) | | #define BCRYPT_KEY_DATA_BLOB_MAGIC 0x4d42444b //Key Data Blob Magic (KDBM) |
| | |
| #define BCRYPT_KEY_DATA_BLOB_VERSION1 0x1 | | #define BCRYPT_KEY_DATA_BLOB_VERSION1 0x1 |
| | |
| // Property Strings for DSA | | // Property Strings for DSA |
| #define BCRYPT_DSA_PARAMETERS L"DSAParameters" | | #define BCRYPT_DSA_PARAMETERS L"DSAParameters" |
| | |
|
| #define BCRYPT_DSA_PARAMETERS_MAGIC 0x4d505344 // DSPM | | #define BCRYPT_DSA_PARAMETERS_MAGIC 0x4d505344 // DSPM |
| | |
| | #define BCRYPT_DSA_PARAMETERS_MAGIC_V2 0x324d5044 // DPM2 |
| | |
| typedef struct _BCRYPT_DSA_PARAMETER_HEADER | | typedef struct _BCRYPT_DSA_PARAMETER_HEADER |
| { | | { |
| ULONG cbLength; | | ULONG cbLength; |
| ULONG dwMagic; | | ULONG dwMagic; |
| ULONG cbKeyLength; | | ULONG cbKeyLength; |
| UCHAR Count[4]; | | UCHAR Count[4]; |
| UCHAR Seed[20]; | | UCHAR Seed[20]; |
| UCHAR q[20]; | | UCHAR q[20]; |
| } BCRYPT_DSA_PARAMETER_HEADER; | | } BCRYPT_DSA_PARAMETER_HEADER; |
| | |
|
| | typedef struct _BCRYPT_DSA_PARAMETER_HEADER_V2 |
| | { |
| | ULONG cbLength; |
| | ULONG dwMagic; |
| | ULONG cbKeyLength; |
| | HASHALGORITHM_ENUM hashAlgorithm; |
| | DSAFIPSVERSION_ENUM standardVersion; |
| | ULONG cbSeedLength; |
| | ULONG cbGroupSize; |
| | UCHAR Count[4]; |
| | } BCRYPT_DSA_PARAMETER_HEADER_V2; |
| | |
| | // Operation types used in BCRYPT_MULTI_HASH_OPERATION structures |
| | typedef enum { |
| | BCRYPT_HASH_OPERATION_HASH_DATA = 1, |
| | BCRYPT_HASH_OPERATION_FINISH_HASH = 2, |
| | } BCRYPT_HASH_OPERATION_TYPE; |
| | |
| | typedef struct _BCRYPT_MULTI_HASH_OPERATION { |
| | ULONG iHash; // i |
| | ndex of hash object |
| | BCRYPT_HASH_OPERATION_TYPE hashOperation; // o |
| | peration to be performed |
| | _Field_size_(cbBuffer) PUCHAR pbBuffer; // d |
| | ata to be hashed, or result buffer |
| | ULONG cbBuffer; |
| | } BCRYPT_MULTI_HASH_OPERATION; |
| | |
| | // Enum to specify type of multi-operation is passed to BCryptProcesMultiOperati |
| | ons |
| | typedef enum{ |
| | BCRYPT_OPERATION_TYPE_HASH = 1, // structure type is BCRYPT_MULTI_HASH_O |
| | PERATION |
| | } BCRYPT_MULTI_OPERATION_TYPE; |
| | |
| | typedef struct _BCRYPT_MULTI_OBJECT_LENGTH_STRUCT |
| | { |
| | ULONG cbPerObject; |
| | ULONG cbPerElement; // required size for N elements is (cbPerObj |
| | ect + N * cbPerElement) |
| | } BCRYPT_MULTI_OBJECT_LENGTH_STRUCT; |
| | |
| // | | // |
| // Microsoft built-in providers. | | // Microsoft built-in providers. |
| // | | // |
| | |
| #define MS_PRIMITIVE_PROVIDER L"Microsoft Primitive Provider" | | #define MS_PRIMITIVE_PROVIDER L"Microsoft Primitive Provider" |
|
| | #define MS_PLATFORM_CRYPTO_PROVIDER L"Microsoft Platform Crypto Prov
ider" |
| | |
| // | | // |
| // Common algorithm identifiers. | | // Common algorithm identifiers. |
| // | | // |
| | |
| #define BCRYPT_RSA_ALGORITHM L"RSA" | | #define BCRYPT_RSA_ALGORITHM L"RSA" |
| #define BCRYPT_RSA_SIGN_ALGORITHM L"RSA_SIGN" | | #define BCRYPT_RSA_SIGN_ALGORITHM L"RSA_SIGN" |
| #define BCRYPT_DH_ALGORITHM L"DH" | | #define BCRYPT_DH_ALGORITHM L"DH" |
| #define BCRYPT_DSA_ALGORITHM L"DSA" | | #define BCRYPT_DSA_ALGORITHM L"DSA" |
| #define BCRYPT_RC2_ALGORITHM L"RC2" | | #define BCRYPT_RC2_ALGORITHM L"RC2" |
| | |
| skipping to change at line 447 | | skipping to change at line 580 |
| #define BCRYPT_3DES_ALGORITHM L"3DES" | | #define BCRYPT_3DES_ALGORITHM L"3DES" |
| #define BCRYPT_3DES_112_ALGORITHM L"3DES_112" | | #define BCRYPT_3DES_112_ALGORITHM L"3DES_112" |
| #define BCRYPT_MD2_ALGORITHM L"MD2" | | #define BCRYPT_MD2_ALGORITHM L"MD2" |
| #define BCRYPT_MD4_ALGORITHM L"MD4" | | #define BCRYPT_MD4_ALGORITHM L"MD4" |
| #define BCRYPT_MD5_ALGORITHM L"MD5" | | #define BCRYPT_MD5_ALGORITHM L"MD5" |
| #define BCRYPT_SHA1_ALGORITHM L"SHA1" | | #define BCRYPT_SHA1_ALGORITHM L"SHA1" |
| #define BCRYPT_SHA256_ALGORITHM L"SHA256" | | #define BCRYPT_SHA256_ALGORITHM L"SHA256" |
| #define BCRYPT_SHA384_ALGORITHM L"SHA384" | | #define BCRYPT_SHA384_ALGORITHM L"SHA384" |
| #define BCRYPT_SHA512_ALGORITHM L"SHA512" | | #define BCRYPT_SHA512_ALGORITHM L"SHA512" |
| #define BCRYPT_AES_GMAC_ALGORITHM L"AES-GMAC" | | #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_P256_ALGORITHM L"ECDSA_P256" |
| #define BCRYPT_ECDSA_P384_ALGORITHM L"ECDSA_P384" | | #define BCRYPT_ECDSA_P384_ALGORITHM L"ECDSA_P384" |
| #define BCRYPT_ECDSA_P521_ALGORITHM L"ECDSA_P521" | | #define BCRYPT_ECDSA_P521_ALGORITHM L"ECDSA_P521" |
| #define BCRYPT_ECDH_P256_ALGORITHM L"ECDH_P256" | | #define BCRYPT_ECDH_P256_ALGORITHM L"ECDH_P256" |
| #define BCRYPT_ECDH_P384_ALGORITHM L"ECDH_P384" | | #define BCRYPT_ECDH_P384_ALGORITHM L"ECDH_P384" |
| #define BCRYPT_ECDH_P521_ALGORITHM L"ECDH_P521" | | #define BCRYPT_ECDH_P521_ALGORITHM L"ECDH_P521" |
| #define BCRYPT_RNG_ALGORITHM L"RNG" | | #define BCRYPT_RNG_ALGORITHM L"RNG" |
| #define BCRYPT_RNG_FIPS186_DSA_ALGORITHM L"FIPS186DSARNG" | | #define BCRYPT_RNG_FIPS186_DSA_ALGORITHM L"FIPS186DSARNG" |
| #define BCRYPT_RNG_DUAL_EC_ALGORITHM L"DUALECRNG" | | #define BCRYPT_RNG_DUAL_EC_ALGORITHM L"DUALECRNG" |
|
| | #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" |
| | |
| // | | // |
| // Interfaces | | // Interfaces |
| // | | // |
| | |
| #define BCRYPT_CIPHER_INTERFACE 0x00000001 | | #define BCRYPT_CIPHER_INTERFACE 0x00000001 |
| #define BCRYPT_HASH_INTERFACE 0x00000002 | | #define BCRYPT_HASH_INTERFACE 0x00000002 |
| #define BCRYPT_ASYMMETRIC_ENCRYPTION_INTERFACE 0x00000003 | | #define BCRYPT_ASYMMETRIC_ENCRYPTION_INTERFACE 0x00000003 |
| #define BCRYPT_SECRET_AGREEMENT_INTERFACE 0x00000004 | | #define BCRYPT_SECRET_AGREEMENT_INTERFACE 0x00000004 |
| #define BCRYPT_SIGNATURE_INTERFACE 0x00000005 | | #define BCRYPT_SIGNATURE_INTERFACE 0x00000005 |
| #define BCRYPT_RNG_INTERFACE 0x00000006 | | #define BCRYPT_RNG_INTERFACE 0x00000006 |
|
| | #define BCRYPT_KEY_DERIVATION_INTERFACE 0x00000007 |
| | |
| // | | // |
| // Primitive algorithm provider functions. | | // Primitive algorithm provider functions. |
| // | | // |
| | |
|
| #define BCRYPT_ALG_HANDLE_HMAC_FLAG 0x00000008 | | #define BCRYPT_ALG_HANDLE_HMAC_FLAG 0x00000008 |
| | #define BCRYPT_CAPI_AES_FLAG 0x00000010 |
| | #define BCRYPT_HASH_REUSABLE_FLAG 0x00000020 |
| | |
|
| __checkReturn | | #if (NTDDI_VERSION > NTDDI_WINBLUE || (NTDDI_VERSION == NTDDI_WINBLUE && defined |
| | (WINBLUE_KBSPRING14))) |
| | #define BCRYPT_MULTI_FLAG 0x00000040 |
| | #endif |
| | |
| | // |
| | // The BUFFERS_LOCKED flag used in BCryptEncrypt/BCryptDecrypt signals that |
| | // the pbInput and pbOutput buffers have been locked (see MmProbeAndLockPages) |
| | // and CNG may not lock the buffers again. |
| | // This flag applies only to kernel mode, it is ignored in user mode. |
| | // |
| | #define BCRYPT_BUFFERS_LOCKED_FLAG 0x00000040 |
| | |
| | // |
| | // The EXTENDED_KEYSIZE flag extends the supported set of key sizes. |
| | // |
| | // The original design has a per-algorithm maximum key size, and |
| | // BCryptGenerateSymmetricKey truncates any longer input to the maximum key size |
| | for that |
| | // algorithm. Some callers depend on this feature and pass in large buffers. |
| | // This makes it impossible to silently extend the supported key size without br |
| | eaking |
| | // backward compatibility. |
| | // This flag indicates that the extended key size support is requested. |
| | // It has the following consequences: |
| | // - BCryptGetProperty will report a new maximum key size for BCRYPT_KEY_LENGTHS |
| | . |
| | // - BCryptGenerateSymmetricKey will support the longer key sizes. |
| | // - BCryptGenerateSymmetricKey will no longer truncate keys that are too long, |
| | but return an error instead. |
| | // |
| | #if (NTDDI_VERSION >= NTDDI_WINBLUE) |
| | #define BCRYPT_EXTENDED_KEYSIZE 0x00000080 |
| | #endif |
| | |
| | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptOpenAlgorithmProvider( | | BCryptOpenAlgorithmProvider( |
|
| __out BCRYPT_ALG_HANDLE *phAlgorithm, | | _Out_ BCRYPT_ALG_HANDLE *phAlgorithm, |
| __in LPCWSTR pszAlgId, | | _In_ LPCWSTR pszAlgId, |
| __in_opt LPCWSTR pszImplementation, | | _In_opt_ LPCWSTR pszImplementation, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
| // AlgOperations flags for use with BCryptEnumAlgorithms() | | // AlgOperations flags for use with BCryptEnumAlgorithms() |
| #define BCRYPT_CIPHER_OPERATION 0x00000001 | | #define BCRYPT_CIPHER_OPERATION 0x00000001 |
| #define BCRYPT_HASH_OPERATION 0x00000002 | | #define BCRYPT_HASH_OPERATION 0x00000002 |
| #define BCRYPT_ASYMMETRIC_ENCRYPTION_OPERATION 0x00000004 | | #define BCRYPT_ASYMMETRIC_ENCRYPTION_OPERATION 0x00000004 |
| #define BCRYPT_SECRET_AGREEMENT_OPERATION 0x00000008 | | #define BCRYPT_SECRET_AGREEMENT_OPERATION 0x00000008 |
| #define BCRYPT_SIGNATURE_OPERATION 0x00000010 | | #define BCRYPT_SIGNATURE_OPERATION 0x00000010 |
| #define BCRYPT_RNG_OPERATION 0x00000020 | | #define BCRYPT_RNG_OPERATION 0x00000020 |
|
| | #define BCRYPT_KEY_DERIVATION_OPERATION 0x00000040 |
| | |
| // USE EXTREME CAUTION: editing comments that contain "certenrolls_*" tokens | | // USE EXTREME CAUTION: editing comments that contain "certenrolls_*" tokens |
| // could break building CertEnroll idl files: | | // could break building CertEnroll idl files: |
| // certenrolls_begin -- BCRYPT_ALGORITHM_IDENTIFIER | | // certenrolls_begin -- BCRYPT_ALGORITHM_IDENTIFIER |
| typedef struct _BCRYPT_ALGORITHM_IDENTIFIER | | typedef struct _BCRYPT_ALGORITHM_IDENTIFIER |
| { | | { |
| LPWSTR pszName; | | LPWSTR pszName; |
| ULONG dwClass; | | ULONG dwClass; |
| ULONG dwFlags; | | ULONG dwFlags; |
| | |
| } BCRYPT_ALGORITHM_IDENTIFIER; | | } BCRYPT_ALGORITHM_IDENTIFIER; |
| // certenrolls_end | | // certenrolls_end |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptEnumAlgorithms( | | BCryptEnumAlgorithms( |
|
| __in ULONG dwAlgOperations, | | _In_ ULONG dwAlgOperations, |
| __out ULONG *pAlgCount, | | _Out_ ULONG *pAlgCount, |
| __out BCRYPT_ALGORITHM_IDENTIFIER **ppAlgList, | | _Out_ BCRYPT_ALGORITHM_IDENTIFIER **ppAlgList, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
| typedef struct _BCRYPT_PROVIDER_NAME | | typedef struct _BCRYPT_PROVIDER_NAME |
| { | | { |
| LPWSTR pszProviderName; | | LPWSTR pszProviderName; |
| } BCRYPT_PROVIDER_NAME; | | } BCRYPT_PROVIDER_NAME; |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptEnumProviders( | | BCryptEnumProviders( |
|
| __in LPCWSTR pszAlgId, | | _In_ LPCWSTR pszAlgId, |
| __out ULONG *pImplCount, | | _Out_ ULONG *pImplCount, |
| __out BCRYPT_PROVIDER_NAME **ppImplList, | | _Out_ BCRYPT_PROVIDER_NAME **ppImplList, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
| // Flags for use with BCryptGetProperty and BCryptSetProperty | | // Flags for use with BCryptGetProperty and BCryptSetProperty |
| #define BCRYPT_PUBLIC_KEY_FLAG 0x00000001 | | #define BCRYPT_PUBLIC_KEY_FLAG 0x00000001 |
| #define BCRYPT_PRIVATE_KEY_FLAG 0x00000002 | | #define BCRYPT_PRIVATE_KEY_FLAG 0x00000002 |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptGetProperty( | | BCryptGetProperty( |
|
| __in BCRYPT_HANDLE hObject, | | _In_ BCRYPT_HANDLE hObject, |
| __in LPCWSTR pszProperty, | | _In_ LPCWSTR pszProperty, |
| __out_bcount_part_opt(cbOutput, *pcbResult) PUCHAR pbOutput, | | _Out_writes_bytes_to_opt_(cbOutput, *pcbResult) PUCHAR pbOutput, |
| __in ULONG cbOutput, | | _In_ ULONG cbOutput, |
| __out ULONG *pcbResult, | | _Out_ ULONG *pcbResult, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptSetProperty( | | BCryptSetProperty( |
|
| __inout BCRYPT_HANDLE hObject, | | _Inout_ BCRYPT_HANDLE hObject, |
| __in LPCWSTR pszProperty, | | _In_ LPCWSTR pszProperty, |
| __in_bcount(cbInput) PUCHAR pbInput, | | _In_reads_bytes_(cbInput) PUCHAR pbInput, |
| __in ULONG cbInput, | | _In_ ULONG cbInput, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptCloseAlgorithmProvider( | | BCryptCloseAlgorithmProvider( |
|
| __inout BCRYPT_ALG_HANDLE hAlgorithm, | | _Inout_ BCRYPT_ALG_HANDLE hAlgorithm, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
| VOID | | VOID |
| WINAPI | | WINAPI |
| BCryptFreeBuffer( | | BCryptFreeBuffer( |
|
| __in PVOID pvBuffer); | | _In_ PVOID pvBuffer); |
| | |
| // | | // |
| // Primitive encryption functions. | | // Primitive encryption functions. |
| // | | // |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptGenerateSymmetricKey( | | BCryptGenerateSymmetricKey( |
|
| __inout BCRYPT_ALG_HANDLE hAlgorithm, | | _Inout_ BCRYPT_ALG_HANDLE hAlgorithm, |
| __out BCRYPT_KEY_HANDLE *phKey, | | _Out_ BCRYPT_KEY_HANDLE *phKey, |
| __out_bcount_full_opt(cbKeyObject) PUCHAR pbKeyObject, | | _Out_writes_bytes_all_opt_(cbKeyObject) PUCHAR pbKeyObject, |
| __in ULONG cbKeyObject, | | _In_ ULONG cbKeyObject, |
| __in_bcount(cbSecret) PUCHAR pbSecret, | | _In_reads_bytes_(cbSecret) PUCHAR pbSecret, |
| __in ULONG cbSecret, | | _In_ ULONG cbSecret, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptGenerateKeyPair( | | BCryptGenerateKeyPair( |
|
| __inout BCRYPT_ALG_HANDLE hAlgorithm, | | _Inout_ BCRYPT_ALG_HANDLE hAlgorithm, |
| __out BCRYPT_KEY_HANDLE *phKey, | | _Out_ BCRYPT_KEY_HANDLE *phKey, |
| __in ULONG dwLength, | | _In_ ULONG dwLength, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptEncrypt( | | BCryptEncrypt( |
|
| __inout BCRYPT_KEY_HANDLE hKey, | | _Inout_ BCRYPT_KEY_HANDLE hKey, |
| __in_bcount_opt(cbInput) PUCHAR pbInput, | | _In_reads_bytes_opt_(cbInput) PUCHAR pbInput, |
| __in ULONG cbInput, | | _In_ ULONG cbInput, |
| __in_opt VOID *pPaddingInfo, | | _In_opt_ VOID *pPaddingInfo, |
| __inout_bcount_opt(cbIV) PUCHAR pbIV, | | _Inout_updates_bytes_opt_(cbIV) PUCHAR pbIV, |
| __in ULONG cbIV, | | _In_ ULONG cbIV, |
| __out_bcount_part_opt(cbOutput, *pcbResult) PUCHAR pbOutput, | | _Out_writes_bytes_to_opt_(cbOutput, *pcbResult) PUCHAR pbOutput, |
| __in ULONG cbOutput, | | _In_ ULONG cbOutput, |
| __out ULONG *pcbResult, | | _Out_ ULONG *pcbResult, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptDecrypt( | | BCryptDecrypt( |
|
| __inout BCRYPT_KEY_HANDLE hKey, | | _Inout_ BCRYPT_KEY_HANDLE hKey, |
| __in_bcount_opt(cbInput) PUCHAR pbInput, | | _In_reads_bytes_opt_(cbInput) PUCHAR pbInput, |
| __in ULONG cbInput, | | _In_ ULONG cbInput, |
| __in_opt VOID *pPaddingInfo, | | _In_opt_ VOID *pPaddingInfo, |
| __inout_bcount_opt(cbIV) PUCHAR pbIV, | | _Inout_updates_bytes_opt_(cbIV) PUCHAR pbIV, |
| __in ULONG cbIV, | | _In_ ULONG cbIV, |
| __out_bcount_part_opt(cbOutput, *pcbResult) PUCHAR pbOutput, | | _Out_writes_bytes_to_opt_(cbOutput, *pcbResult) PUCHAR pbOutput, |
| __in ULONG cbOutput, | | _In_ ULONG cbOutput, |
| __out ULONG *pcbResult, | | _Out_ ULONG *pcbResult, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptExportKey( | | BCryptExportKey( |
|
| __in BCRYPT_KEY_HANDLE hKey, | | _In_ BCRYPT_KEY_HANDLE hKey, |
| __in_opt BCRYPT_KEY_HANDLE hExportKey, | | _In_opt_ BCRYPT_KEY_HANDLE hExportKey, |
| __in LPCWSTR pszBlobType, | | _In_ LPCWSTR pszBlobType, |
| __out_bcount_part_opt(cbOutput, *pcbResult) PUCHAR pbOutput, | | _Out_writes_bytes_to_opt_(cbOutput, *pcbResult) PUCHAR pbOutput, |
| __in ULONG cbOutput, | | _In_ ULONG cbOutput, |
| __out ULONG *pcbResult, | | _Out_ ULONG *pcbResult, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptImportKey( | | BCryptImportKey( |
|
| __in BCRYPT_ALG_HANDLE hAlgorithm, | | _In_ BCRYPT_ALG_HANDLE hAlgorithm, |
| __in_opt BCRYPT_KEY_HANDLE hImportKey, | | _In_opt_ BCRYPT_KEY_HANDLE hImportKey, |
| __in LPCWSTR pszBlobType, | | _In_ LPCWSTR pszBlobType, |
| __out BCRYPT_KEY_HANDLE *phKey, | | _Out_ BCRYPT_KEY_HANDLE *phKey, |
| __out_bcount_full_opt(cbKeyObject) PUCHAR pbKeyObject, | | _Out_writes_bytes_all_opt_(cbKeyObject) PUCHAR pbKeyObject, |
| __in ULONG cbKeyObject, | | _In_ ULONG cbKeyObject, |
| __in_bcount(cbInput) PUCHAR pbInput, | | _In_reads_bytes_(cbInput) PUCHAR pbInput, |
| __in ULONG cbInput, | | _In_ ULONG cbInput, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
| #define BCRYPT_NO_KEY_VALIDATION 0x00000008 | | #define BCRYPT_NO_KEY_VALIDATION 0x00000008 |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptImportKeyPair( | | BCryptImportKeyPair( |
|
| __in BCRYPT_ALG_HANDLE hAlgorithm, | | _In_ BCRYPT_ALG_HANDLE hAlgorithm, |
| __in_opt BCRYPT_KEY_HANDLE hImportKey, | | _In_opt_ BCRYPT_KEY_HANDLE hImportKey, |
| __in LPCWSTR pszBlobType, | | _In_ LPCWSTR pszBlobType, |
| __out BCRYPT_KEY_HANDLE *phKey, | | _Out_ BCRYPT_KEY_HANDLE *phKey, |
| __in_bcount(cbInput) PUCHAR pbInput, | | _In_reads_bytes_(cbInput) PUCHAR pbInput, |
| __in ULONG cbInput, | | _In_ ULONG cbInput, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptDuplicateKey( | | BCryptDuplicateKey( |
|
| __in BCRYPT_KEY_HANDLE hKey, | | _In_ BCRYPT_KEY_HANDLE hKey, |
| __out BCRYPT_KEY_HANDLE *phNewKey, | | _Out_ BCRYPT_KEY_HANDLE *phNewKey, |
| __out_bcount_full_opt(cbKeyObject) PUCHAR pbKeyObject, | | _Out_writes_bytes_all_opt_(cbKeyObject) PUCHAR pbKeyObject, |
| __in ULONG cbKeyObject, | | _In_ ULONG cbKeyObject, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptFinalizeKeyPair( | | BCryptFinalizeKeyPair( |
|
| __inout BCRYPT_KEY_HANDLE hKey, | | _Inout_ BCRYPT_KEY_HANDLE hKey, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptDestroyKey( | | BCryptDestroyKey( |
|
| __inout BCRYPT_KEY_HANDLE hKey); | | _Inout_ BCRYPT_KEY_HANDLE hKey); |
| | |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptDestroySecret( | | BCryptDestroySecret( |
|
| __inout BCRYPT_SECRET_HANDLE hSecret); | | _Inout_ BCRYPT_SECRET_HANDLE hSecret); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptSignHash( | | BCryptSignHash( |
|
| __in BCRYPT_KEY_HANDLE hKey, | | _In_ BCRYPT_KEY_HANDLE hKey, |
| __in_opt VOID *pPaddingInfo, | | _In_opt_ VOID *pPaddingInfo, |
| __in_bcount(cbInput) PUCHAR pbInput, | | _In_reads_bytes_(cbInput) PUCHAR pbInput, |
| __in ULONG cbInput, | | _In_ ULONG cbInput, |
| __out_bcount_part_opt(cbOutput, *pcbResult) PUCHAR pbOutput, | | _Out_writes_bytes_to_opt_(cbOutput, *pcbResult) PUCHAR pbOutput, |
| __in ULONG cbOutput, | | _In_ ULONG cbOutput, |
| __out ULONG *pcbResult, | | _Out_ ULONG *pcbResult, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptVerifySignature( | | BCryptVerifySignature( |
|
| __in BCRYPT_KEY_HANDLE hKey, | | _In_ BCRYPT_KEY_HANDLE hKey, |
| __in_opt VOID *pPaddingInfo, | | _In_opt_ VOID *pPaddingInfo, |
| __in_bcount(cbHash) PUCHAR pbHash, | | _In_reads_bytes_(cbHash) PUCHAR pbHash, |
| __in ULONG cbHash, | | _In_ ULONG cbHash, |
| __in_bcount(cbSignature) PUCHAR pbSignature, | | _In_reads_bytes_(cbSignature) PUCHAR pbSignature, |
| __in ULONG cbSignature, | | _In_ ULONG cbSignature, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptSecretAgreement( | | BCryptSecretAgreement( |
|
| __in BCRYPT_KEY_HANDLE hPrivKey, | | _In_ BCRYPT_KEY_HANDLE hPrivKey, |
| __in BCRYPT_KEY_HANDLE hPubKey, | | _In_ BCRYPT_KEY_HANDLE hPubKey, |
| __out BCRYPT_SECRET_HANDLE *phAgreedSecret, | | _Out_ BCRYPT_SECRET_HANDLE *phAgreedSecret, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptDeriveKey( | | BCryptDeriveKey( |
|
| __in BCRYPT_SECRET_HANDLE hSharedSecret, | | _In_ BCRYPT_SECRET_HANDLE hSharedSecret, |
| __in LPCWSTR pwszKDF, | | _In_ LPCWSTR pwszKDF, |
| __in_opt BCryptBufferDesc *pParameterList, | | _In_opt_ BCryptBufferDesc *pParameterList, |
| __out_bcount_part_opt(cbDerivedKey, *pcbResult) PUCHAR pbDerivedKey, | | _Out_writes_bytes_to_opt_(cbDerivedKey, *pcbResult) PUCHAR pbDerivedKey, |
| __in ULONG cbDerivedKey, | | _In_ ULONG cbDerivedKey, |
| __out ULONG *pcbResult, | | _Out_ ULONG *pcbResult, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
| | _Must_inspect_result_ |
| | NTSTATUS |
| | WINAPI |
| | BCryptKeyDerivation( |
| | _In_ BCRYPT_KEY_HANDLE hKey, |
| | _In_opt_ BCryptBufferDesc *pParameterList, |
| | _Out_writes_bytes_to_(cbDerivedKey, *pcbResult) PUCHAR pbDerivedKey, |
| | _In_ ULONG cbDerivedKey, |
| | _Out_ ULONG *pcbResult, |
| | _In_ ULONG dwFlags); |
| | |
| // | | // |
| // Primitive hashing functions. | | // Primitive hashing functions. |
| // | | // |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptCreateHash( | | BCryptCreateHash( |
|
| __inout BCRYPT_ALG_HANDLE hAlgorithm, | | _Inout_ BCRYPT_ALG_HANDLE hAlgorithm, |
| __out BCRYPT_HASH_HANDLE *phHash, | | _Out_ BCRYPT_HASH_HANDLE *phHash, |
| __out_bcount_full_opt(cbHashObject) PUCHAR pbHashObject, | | _Out_writes_bytes_all_opt_(cbHashObject) PUCHAR pbHashObject, |
| __in ULONG cbHashObject, | | _In_ ULONG cbHashObject, |
| __in_bcount_opt(cbSecret) PUCHAR pbSecret, // optional | | _In_reads_bytes_opt_(cbSecret) PUCHAR pbSecret, // optional |
| __in ULONG cbSecret, // optional | | _In_ ULONG cbSecret, // optional |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptHashData( | | BCryptHashData( |
|
| __inout BCRYPT_HASH_HANDLE hHash, | | _Inout_ BCRYPT_HASH_HANDLE hHash, |
| __in_bcount(cbInput) PUCHAR pbInput, | | _In_reads_bytes_(cbInput) PUCHAR pbInput, |
| __in ULONG cbInput, | | _In_ ULONG cbInput, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptFinishHash( | | BCryptFinishHash( |
|
| __inout BCRYPT_HASH_HANDLE hHash, | | _Inout_ BCRYPT_HASH_HANDLE hHash, |
| __out_bcount_full(cbOutput) PUCHAR pbOutput, | | _Out_writes_bytes_all_(cbOutput) PUCHAR pbOutput, |
| __in ULONG cbOutput, | | _In_ ULONG cbOutput, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
|
| __checkReturn | | #if (NTDDI_VERSION > NTDDI_WINBLUE || (NTDDI_VERSION == NTDDI_WINBLUE && defined |
| | (WINBLUE_KBSPRING14))) |
| | _Must_inspect_result_ |
| | NTSTATUS |
| | WINAPI |
| | BCryptCreateMultiHash( |
| | _Inout_ BCRYPT_ALG_HANDLE hAlgorithm, |
| | _Out_ BCRYPT_HASH_HANDLE *phHash, |
| | _In_ ULONG nHashes, |
| | _Out_writes_bytes_all_opt_(cbHashObject) PUCHAR pbHashObject |
| | , |
| | _In_ ULONG cbHashObject |
| | , |
| | _In_reads_bytes_opt_(cbSecret) PUCHAR pbSecret, |
| | // optional |
| | _In_ ULONG cbSecret, |
| | // optional |
| | _In_ ULONG dwFlags); |
| | |
| | _Must_inspect_result_ |
| | NTSTATUS |
| | WINAPI |
| | BCryptProcessMultiOperations( |
| | _Inout_ BCRYPT_HANDLE hObject, |
| | _In_ BCRYPT_MULTI_OPERATION_TYPE operationTyp |
| | e, |
| | _In_reads_bytes_(cbOperations) PVOID pOperations, |
| | _In_ ULONG cbOperations |
| | , |
| | _In_ ULONG dwFlags ); |
| | #endif |
| | |
| | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptDuplicateHash( | | BCryptDuplicateHash( |
|
| __in BCRYPT_HASH_HANDLE hHash, | | _In_ BCRYPT_HASH_HANDLE hHash, |
| __out BCRYPT_HASH_HANDLE *phNewHash, | | _Out_ BCRYPT_HASH_HANDLE *phNewHash, |
| __out_bcount_full_opt(cbHashObject) PUCHAR pbHashObject, | | _Out_writes_bytes_all_opt_(cbHashObject) PUCHAR pbHashObject, |
| __in ULONG cbHashObject, | | _In_ ULONG cbHashObject, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptDestroyHash( | | BCryptDestroyHash( |
|
| __inout BCRYPT_HASH_HANDLE hHash); | | _Inout_ BCRYPT_HASH_HANDLE hHash); |
| | |
| // | | // |
| // Primitive random number generation. | | // Primitive random number generation. |
| // | | // |
| | |
| // Flags to BCryptGenRandom | | // Flags to BCryptGenRandom |
| #define BCRYPT_RNG_USE_ENTROPY_IN_BUFFER 0x00000001 | | #define BCRYPT_RNG_USE_ENTROPY_IN_BUFFER 0x00000001 |
| #define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002 | | #define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002 |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptGenRandom( | | BCryptGenRandom( |
|
| __in_opt BCRYPT_ALG_HANDLE hAlgorithm, | | _In_opt_ BCRYPT_ALG_HANDLE hAlgorithm, |
| __inout_bcount_full(cbBuffer) PUCHAR pbBuffer, | | _Inout_updates_bytes_all_(cbBuffer) PUCHAR pbBuffer, |
| __in ULONG cbBuffer, | | _In_ ULONG cbBuffer, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
| // | | // |
| // Primitive key derivation functions. | | // Primitive key derivation functions. |
| // | | // |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptDeriveKeyCapi( | | BCryptDeriveKeyCapi( |
|
| __in BCRYPT_HASH_HANDLE hHash, | | _In_ BCRYPT_HASH_HANDLE hHash, |
| __in_opt BCRYPT_ALG_HANDLE hTargetAlg, | | _In_opt_ BCRYPT_ALG_HANDLE hTargetAlg, |
| __out_bcount( cbDerivedKey ) PUCHAR pbDerivedKey, | | _Out_writes_bytes_( cbDerivedKey ) PUCHAR pbDerivedKey, |
| __in ULONG cbDerivedKey, | | _In_ ULONG cbDerivedKey, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptDeriveKeyPBKDF2( | | BCryptDeriveKeyPBKDF2( |
|
| __in BCRYPT_ALG_HANDLE hPrf, | | _In_ BCRYPT_ALG_HANDLE hPrf, |
| __in_bcount_opt( cbPassword ) PUCHAR pbPassword, | | _In_reads_bytes_opt_( cbPassword ) PUCHAR pbPassword, |
| __in ULONG cbPassword, | | _In_ ULONG cbPassword, |
| __in_bcount_opt( cbSalt ) PUCHAR pbSalt, | | _In_reads_bytes_opt_( cbSalt ) PUCHAR pbSalt, |
| __in ULONG cbSalt, | | _In_ ULONG cbSalt, |
| __in ULONGLONG cIterations, | | _In_ ULONGLONG cIterations, |
| __out_bcount( cbDerivedKey ) PUCHAR pbDerivedKey, | | _Out_writes_bytes_( cbDerivedKey ) PUCHAR pbDerivedKey, |
| __in ULONG cbDerivedKey, | | _In_ ULONG cbDerivedKey, |
| __in ULONG dwFlags); | | _In_ ULONG dwFlags); |
| | |
| // | | // |
| // Interface version control... | | // Interface version control... |
| // | | // |
| typedef struct _BCRYPT_INTERFACE_VERSION | | typedef struct _BCRYPT_INTERFACE_VERSION |
| { | | { |
| USHORT MajorVersion; | | USHORT MajorVersion; |
| USHORT MinorVersion; | | USHORT MinorVersion; |
| | |
| } BCRYPT_INTERFACE_VERSION, *PBCRYPT_INTERFACE_VERSION; | | } BCRYPT_INTERFACE_VERSION, *PBCRYPT_INTERFACE_VERSION; |
| | |
| skipping to change at line 841 | | skipping to change at line 1049 |
| | |
| #define BCRYPT_IS_INTERFACE_VERSION_COMPATIBLE(loader, provider) \ | | #define BCRYPT_IS_INTERFACE_VERSION_COMPATIBLE(loader, provider) \ |
| ((loader).MajorVersion <= (provider).MajorVersion) | | ((loader).MajorVersion <= (provider).MajorVersion) |
| | |
| // | | // |
| // Primitive provider interfaces. | | // Primitive provider interfaces. |
| // | | // |
| | |
| #define BCRYPT_CIPHER_INTERFACE_VERSION_1 BCRYPT_MAKE_INTERFACE_VERSION(1,0) | | #define BCRYPT_CIPHER_INTERFACE_VERSION_1 BCRYPT_MAKE_INTERFACE_VERSION(1,0) |
| | |
|
| #define BCRYPT_HASH_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(BC |
| | RYPT_HASH_INTERFACE_MAJORVERSION_2,0) |
| | #endif |
| | |
| #define BCRYPT_ASYMMETRIC_ENCRYPTION_INTERFACE_VERSION_1 BCRYPT_MAKE_INTERFAC
E_VERSION(1,0) | | #define BCRYPT_ASYMMETRIC_ENCRYPTION_INTERFACE_VERSION_1 BCRYPT_MAKE_INTERFAC
E_VERSION(1,0) |
| | |
| #define BCRYPT_SECRET_AGREEMENT_INTERFACE_VERSION_1 BCRYPT_MAKE_INTERFACE_VER
SION(1,0) | | #define BCRYPT_SECRET_AGREEMENT_INTERFACE_VERSION_1 BCRYPT_MAKE_INTERFACE_VER
SION(1,0) |
| | |
| #define BCRYPT_SIGNATURE_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 BCRYPT_RNG_INTERFACE_VERSION_1 BCRYPT_MAKE_INTERFACE_VERSION(1,0) |
| | |
| ////////////////////////////////////////////////////////////////////////////// | | ////////////////////////////////////////////////////////////////////////////// |
| | |
| skipping to change at line 1023 | | skipping to change at line 1236 |
| PCRYPT_PROVIDER_REF *rgpProviders; | | PCRYPT_PROVIDER_REF *rgpProviders; |
| } | | } |
| CRYPT_PROVIDER_REFS, *PCRYPT_PROVIDER_REFS; | | CRYPT_PROVIDER_REFS, *PCRYPT_PROVIDER_REFS; |
| | |
| ////////////////////////////////////////////////////////////////////////////// | | ////////////////////////////////////////////////////////////////////////////// |
| // CryptoConfig Functions //////////////////////////////////////////////////// | | // CryptoConfig Functions //////////////////////////////////////////////////// |
| ////////////////////////////////////////////////////////////////////////////// | | ////////////////////////////////////////////////////////////////////////////// |
| | |
| #ifndef KERNEL_MODE_CNG | | #ifndef KERNEL_MODE_CNG |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptQueryProviderRegistration( | | BCryptQueryProviderRegistration( |
|
| __in LPCWSTR pszProvider, | | _In_ LPCWSTR pszProvider, |
| __in ULONG dwMode, | | _In_ ULONG dwMode, |
| __in ULONG dwInterface, | | _In_ ULONG dwInterface, |
| __inout ULONG* pcbBuffer, | | _Inout_ ULONG* pcbBuffer, |
| __deref_opt_inout_bcount_part_opt(*pcbBuffer, *pcbBuffer) PCRYPT_PROVIDER_RE | | _Inout_ |
| G *ppBuffer); | | _When_(_Old_(*ppBuffer) != NULL, _At_(*ppBuffer, _Out_writes_bytes_to_(* |
| | pcbBuffer, *pcbBuffer))) |
| | _When_(_Old_(*ppBuffer) == NULL, _Outptr_result_bytebuffer_all_(*pcbBuff |
| | er)) |
| | PCRYPT_PROVIDER_REG *ppBuffer); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptEnumRegisteredProviders( | | BCryptEnumRegisteredProviders( |
|
| __inout ULONG* pcbBuffer, | | _Inout_ ULONG* pcbBuffer, |
| __deref_opt_inout_bcount_part_opt(*pcbBuffer, *pcbBuffer) PCRYPT_PROVIDERS * | | _Inout_ |
| ppBuffer); | | _When_(_Old_(*ppBuffer) != NULL, _At_(*ppBuffer, _Out_writes_bytes_to_(* |
| | pcbBuffer, *pcbBuffer))) |
| | _When_(_Old_(*ppBuffer) == NULL, _Outptr_result_bytebuffer_all_(*pcbBuff |
| | er)) |
| | PCRYPT_PROVIDERS *ppBuffer); |
| | |
| // | | // |
| // Context Configuration Functions | | // Context Configuration Functions |
| // | | // |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptCreateContext( | | BCryptCreateContext( |
|
| __in ULONG dwTable, | | _In_ ULONG dwTable, |
| __in LPCWSTR pszContext, | | _In_ LPCWSTR pszContext, |
| __in_opt PCRYPT_CONTEXT_CONFIG pConfig); // Optional | | _In_opt_ PCRYPT_CONTEXT_CONFIG pConfig); // Optional |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptDeleteContext( | | BCryptDeleteContext( |
|
| __in ULONG dwTable, | | _In_ ULONG dwTable, |
| __in LPCWSTR pszContext); | | _In_ LPCWSTR pszContext); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptEnumContexts( | | BCryptEnumContexts( |
|
| __in ULONG dwTable, | | _In_ ULONG dwTable, |
| __inout ULONG* pcbBuffer, | | _Inout_ ULONG* pcbBuffer, |
| __deref_opt_inout_bcount_part_opt(*pcbBuffer, *pcbBuffer) PCRYPT_CONTEXTS *p | | _Inout_ |
| pBuffer); | | _When_(_Old_(*ppBuffer) != NULL, _At_(*ppBuffer, _Out_writes_bytes_to_(* |
| | pcbBuffer, *pcbBuffer))) |
| | _When_(_Old_(*ppBuffer) == NULL, _Outptr_result_bytebuffer_all_(*pcbBuff |
| | er)) |
| | PCRYPT_CONTEXTS *ppBuffer); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptConfigureContext( | | BCryptConfigureContext( |
|
| __in ULONG dwTable, | | _In_ ULONG dwTable, |
| __in LPCWSTR pszContext, | | _In_ LPCWSTR pszContext, |
| __in PCRYPT_CONTEXT_CONFIG pConfig); | | _In_ PCRYPT_CONTEXT_CONFIG pConfig); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptQueryContextConfiguration( | | BCryptQueryContextConfiguration( |
|
| __in ULONG dwTable, | | _In_ ULONG dwTable, |
| __in LPCWSTR pszContext, | | _In_ LPCWSTR pszContext, |
| __inout ULONG* pcbBuffer, | | _Inout_ ULONG* pcbBuffer, |
| __deref_opt_inout_bcount_part_opt(*pcbBuffer, *pcbBuffer) PCRYPT_CONTEXT_CON | | _Inout_ |
| FIG *ppBuffer); | | _When_(_Old_(*ppBuffer) != NULL, _At_(*ppBuffer, _Out_writes_bytes_to_(* |
| | pcbBuffer, *pcbBuffer))) |
| | _When_(_Old_(*ppBuffer) == NULL, _Outptr_result_bytebuffer_all_(*pcbBuff |
| | er)) |
| | PCRYPT_CONTEXT_CONFIG *ppBuffer); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptAddContextFunction( | | BCryptAddContextFunction( |
|
| __in ULONG dwTable, | | _In_ ULONG dwTable, |
| __in LPCWSTR pszContext, | | _In_ LPCWSTR pszContext, |
| __in ULONG dwInterface, | | _In_ ULONG dwInterface, |
| __in LPCWSTR pszFunction, | | _In_ LPCWSTR pszFunction, |
| __in ULONG dwPosition); | | _In_ ULONG dwPosition); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptRemoveContextFunction( | | BCryptRemoveContextFunction( |
|
| __in ULONG dwTable, | | _In_ ULONG dwTable, |
| __in LPCWSTR pszContext, | | _In_ LPCWSTR pszContext, |
| __in ULONG dwInterface, | | _In_ ULONG dwInterface, |
| __in LPCWSTR pszFunction); | | _In_ LPCWSTR pszFunction); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptEnumContextFunctions( | | BCryptEnumContextFunctions( |
|
| __in ULONG dwTable, | | _In_ ULONG dwTable, |
| __in LPCWSTR pszContext, | | _In_ LPCWSTR pszContext, |
| __in ULONG dwInterface, | | _In_ ULONG dwInterface, |
| __inout ULONG* pcbBuffer, | | _Inout_ ULONG* pcbBuffer, |
| __deref_opt_inout_bcount_part_opt(*pcbBuffer, *pcbBuffer) PCRYPT_CONTEXT_FUN | | _Inout_ |
| CTIONS *ppBuffer); | | _When_(_Old_(*ppBuffer) != NULL, _At_(*ppBuffer, _Out_writes_bytes_to_(* |
| | pcbBuffer, *pcbBuffer))) |
| | _When_(_Old_(*ppBuffer) == NULL, _Outptr_result_bytebuffer_all_(*pcbBuff |
| | er)) |
| | PCRYPT_CONTEXT_FUNCTIONS *ppBuffer); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptConfigureContextFunction( | | BCryptConfigureContextFunction( |
|
| __in ULONG dwTable, | | _In_ ULONG dwTable, |
| __in LPCWSTR pszContext, | | _In_ LPCWSTR pszContext, |
| __in ULONG dwInterface, | | _In_ ULONG dwInterface, |
| __in LPCWSTR pszFunction, | | _In_ LPCWSTR pszFunction, |
| __in PCRYPT_CONTEXT_FUNCTION_CONFIG pConfig); | | _In_ PCRYPT_CONTEXT_FUNCTION_CONFIG pConfig); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptQueryContextFunctionConfiguration( | | BCryptQueryContextFunctionConfiguration( |
|
| __in ULONG dwTable, | | _In_ ULONG dwTable, |
| __in LPCWSTR pszContext, | | _In_ LPCWSTR pszContext, |
| __in ULONG dwInterface, | | _In_ ULONG dwInterface, |
| __in LPCWSTR pszFunction, | | _In_ LPCWSTR pszFunction, |
| __inout ULONG* pcbBuffer, | | _Inout_ ULONG* pcbBuffer, |
| __deref_opt_inout_bcount_part_opt(*pcbBuffer, *pcbBuffer) PCRYPT_CONTEXT_FUN | | _Inout_ |
| CTION_CONFIG *ppBuffer); | | _When_(_Old_(*ppBuffer) != NULL, _At_(*ppBuffer, _Out_writes_bytes_to_(* |
| | pcbBuffer, *pcbBuffer))) |
| | _When_(_Old_(*ppBuffer) == NULL, _Outptr_result_bytebuffer_all_(*pcbBuff |
| | er)) |
| | PCRYPT_CONTEXT_FUNCTION_CONFIG *ppBuffer); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptEnumContextFunctionProviders( | | BCryptEnumContextFunctionProviders( |
|
| __in ULONG dwTable, | | _In_ ULONG dwTable, |
| __in LPCWSTR pszContext, | | _In_ LPCWSTR pszContext, |
| __in ULONG dwInterface, | | _In_ ULONG dwInterface, |
| __in LPCWSTR pszFunction, | | _In_ LPCWSTR pszFunction, |
| __inout ULONG* pcbBuffer, | | _Inout_ ULONG* pcbBuffer, |
| __deref_opt_inout_bcount_part_opt(*pcbBuffer, *pcbBuffer) PCRYPT_CONTEXT_FUN | | _Inout_ |
| CTION_PROVIDERS *ppBuffer); | | _When_(_Old_(*ppBuffer) != NULL, _At_(*ppBuffer, _Out_writes_bytes_to_(* |
| | pcbBuffer, *pcbBuffer))) |
| | _When_(_Old_(*ppBuffer) == NULL, _Outptr_result_bytebuffer_all_(*pcbBuff |
| | er)) |
| | PCRYPT_CONTEXT_FUNCTION_PROVIDERS *ppBuffer); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptSetContextFunctionProperty( | | BCryptSetContextFunctionProperty( |
|
| __in ULONG dwTable, | | _In_ ULONG dwTable, |
| __in LPCWSTR pszContext, | | _In_ LPCWSTR pszContext, |
| __in ULONG dwInterface, | | _In_ ULONG dwInterface, |
| __in LPCWSTR pszFunction, | | _In_ LPCWSTR pszFunction, |
| __in LPCWSTR pszProperty, | | _In_ LPCWSTR pszProperty, |
| __in ULONG cbValue, | | _In_ ULONG cbValue, |
| __in_bcount_opt(cbValue) PUCHAR pbValue); | | _In_reads_bytes_opt_(cbValue) PUCHAR pbValue); |
| | |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptQueryContextFunctionProperty( | | BCryptQueryContextFunctionProperty( |
|
| __in ULONG dwTable, | | _In_ ULONG dwTable, |
| __in LPCWSTR pszContext, | | _In_ LPCWSTR pszContext, |
| __in ULONG dwInterface, | | _In_ ULONG dwInterface, |
| __in LPCWSTR pszFunction, | | _In_ LPCWSTR pszFunction, |
| __in LPCWSTR pszProperty, | | _In_ LPCWSTR pszProperty, |
| __inout ULONG* pcbValue, | | _Inout_ ULONG* pcbValue, |
| __deref_opt_inout_bcount_part_opt(*pcbValue, *pcbValue) PUCHAR *ppbValue); | | _Inout_ |
| | _When_(_Old_(*ppbValue) != NULL, _At_(*ppbValue, _Out_writes_bytes_to_(* |
| | pcbValue, *pcbValue))) |
| | _When_(_Old_(*ppbValue) == NULL, _Outptr_result_bytebuffer_all_(*pcbValu |
| | e)) |
| | PUCHAR *ppbValue); |
| | |
| #endif //#ifndef KERNEL_MODE_CNG | | #endif //#ifndef KERNEL_MODE_CNG |
| | |
| // | | // |
| // Configuration Change Notification Functions | | // Configuration Change Notification Functions |
| // | | // |
| | |
| #ifdef KERNEL_MODE_CNG | | #ifdef KERNEL_MODE_CNG |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptRegisterConfigChangeNotify( | | BCryptRegisterConfigChangeNotify( |
|
| __in PRKEVENT pEvent); | | _In_ PRKEVENT pEvent); |
| | |
| #else | | #else |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptRegisterConfigChangeNotify( | | BCryptRegisterConfigChangeNotify( |
|
| __out HANDLE *phEvent); | | _Out_ HANDLE *phEvent); |
| #endif | | #endif |
| | |
| #ifdef KERNEL_MODE_CNG | | #ifdef KERNEL_MODE_CNG |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptUnregisterConfigChangeNotify( | | BCryptUnregisterConfigChangeNotify( |
|
| __in PRKEVENT pEvent); | | _In_ PRKEVENT pEvent); |
| | |
| #else | | #else |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptUnregisterConfigChangeNotify( | | BCryptUnregisterConfigChangeNotify( |
|
| __in HANDLE hEvent); | | _In_ HANDLE hEvent); |
| #endif | | #endif |
| | |
| // | | // |
| // Provider Resolution Functions | | // Provider Resolution Functions |
| // | | // |
|
| __checkReturn | | _Must_inspect_result_ |
| NTSTATUS WINAPI | | NTSTATUS WINAPI |
| BCryptResolveProviders( | | BCryptResolveProviders( |
|
| __in_opt LPCWSTR pszContext, | | _In_opt_ LPCWSTR pszContext, |
| __in_opt ULONG dwInterface, | | _In_opt_ ULONG dwInterface, |
| __in_opt LPCWSTR pszFunction, | | _In_opt_ LPCWSTR pszFunction, |
| __in_opt LPCWSTR pszProvider, | | _In_opt_ LPCWSTR pszProvider, |
| __in ULONG dwMode, | | _In_ ULONG dwMode, |
| __in ULONG dwFlags, | | _In_ ULONG dwFlags, |
| __inout ULONG* pcbBuffer, | | _Inout_ ULONG* pcbBuffer, |
| __deref_opt_inout_bcount_part_opt(*pcbBuffer, *pcbBuffer) PCRYPT_PROVIDER_RE | | _Inout_ |
| FS *ppBuffer); | | _When_(_Old_(*ppBuffer) != NULL, _At_(*ppBuffer, _Out_writes_bytes_to_(* |
| | pcbBuffer, *pcbBuffer))) |
| | _When_(_Old_(*ppBuffer) == NULL, _Outptr_result_bytebuffer_all_(*pcbBuff |
| | er)) |
| | PCRYPT_PROVIDER_REFS *ppBuffer); |
| | |
| // | | // |
| // Miscellaneous queries about the crypto environment | | // Miscellaneous queries about the crypto environment |
| // | | // |
| NTSTATUS | | NTSTATUS |
| WINAPI | | WINAPI |
| BCryptGetFipsAlgorithmMode( | | BCryptGetFipsAlgorithmMode( |
|
| __out BOOLEAN *pfEnabled | | _Out_ BOOLEAN *pfEnabled |
| ); | | ); |
| | |
|
| | #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */ |
| | #pragma endregion |
| | |
| #ifdef __cplusplus | | #ifdef __cplusplus |
| } | | } |
| #endif | | #endif |
| | |
| #endif // __BCRYPT_H__ | | #endif // __BCRYPT_H__ |
| | |
| End of changes. 116 change blocks. |
| 292 lines changed or deleted | | 570 lines changed or added |
|