core.sys.windows.bcrypt

Cryptographic primitives

Translated from MinGW-w64 Windows headers

License

Boost License 1.0

Authors

Aya Partridge

Source: core/sys/windows/_bcrypt.d

Types 70

Fields
ULONG dwMinLength
ULONG dwMaxLength
ULONG dwIncrement
Fields
ULONG cbOID
PUCHAR pbOID
Fields
ULONG dwOIDCount
BCRYPT_OID * pOIDs
Fields
LPCWSTR pszAlgId
ULONG cbSalt
Fields
LPCWSTR pszAlgId
PUCHAR pbLabel
ULONG cbLabel
Fields
ULONG cbSize
ULONG dwInfoVersion
PUCHAR pbNonce
ULONG cbNonce
PUCHAR pbAuthData
ULONG cbAuthData
PUCHAR pbTag
ULONG cbTag
PUCHAR pbMacContext
ULONG cbMacContext
ULONG cbAAD
ULONGLONG cbData
ULONG dwFlags
Fields
ULONG cbBuffer
ULONG BufferType
PVOID pvBuffer
Fields
ULONG ulVersion
ULONG cBuffers
PBCryptBuffer pBuffers
Fields
ULONG Magic
Fields
ULONG Magic
ULONG BitLength
ULONG cbPublicExp
ULONG cbModulus
ULONG cbPrime1
ULONG cbPrime2
Fields
ULONG dwMagic
ULONG cbKey
Fields
ULONG dwMagic
ULONG cbKey
Fields
ULONG cbLength
ULONG dwMagic
ULONG cbKeyLength
Fields
ULONG dwMagic
ULONG cbKey
UCHAR[4] Count
UCHAR[20] Seed
UCHAR[20] q
Fields
ULONG dwMagic
ULONG cbKey
HASHALGORITHM_ENUM hashAlgorithm
DSAFIPSVERSION_ENUM standardVersion
ULONG cbSeedLength
ULONG cbGroupSize
UCHAR[4] Count
Fields
ULONG dwMagic
ULONG dwVersion
ULONG cbKeyData
Fields
ULONG cbLength
ULONG dwMagic
ULONG cbKeyLength
UCHAR[4] Count
UCHAR[20] Seed
UCHAR[20] q
Fields
ULONG cbLength
ULONG dwMagic
ULONG cbKeyLength
HASHALGORITHM_ENUM hashAlgorithm
DSAFIPSVERSION_ENUM standardVersion
ULONG cbSeedLength
ULONG cbGroupSize
UCHAR[4] Count
Fields
ULONG dwEccCurveNames
LPWSTR * pEccCurveNames
Fields
ULONG iHash
PUCHAR pbBuffer
ULONG cbBuffer
Fields
ULONG cbPerObject
ULONG cbPerElement
Fields
LPWSTR pszName
ULONG dwClass
ULONG dwFlags
Fields
LPWSTR pszProviderName
Fields
USHORT MajorVersion
USHORT MinorVersion
Fields
ULONG dwInterface
ULONG dwFlags
ULONG cFunctions
PWSTR * rgpszFunctions
Fields
PWSTR pszImage
ULONG cInterfaces
PCRYPT_INTERFACE_REG * rgpInterfaces
Fields
ULONG cAliases
PWSTR * rgpszAliases
Fields
ULONG cProviders
PWSTR * rgpszProviders
Fields
ULONG dwFlags
ULONG dwReserved
Fields
ULONG dwFlags
ULONG dwReserved
Fields
ULONG cContexts
PWSTR * rgpszContexts
Fields
ULONG cFunctions
PWSTR * rgpszFunctions
Fields
ULONG cProviders
PWSTR * rgpszProviders
Fields
PWSTR pszProperty
ULONG cbValue
PUCHAR pbValue
Fields
PWSTR pszImage
ULONG dwFlags
Fields
ULONG dwInterface
PWSTR pszFunction
PWSTR pszProvider
ULONG cProperties
PCRYPT_PROPERTY_REF * rgpProperties
Fields
ULONG cProviders
PCRYPT_PROVIDER_REF * rgpProviders

Functions 54

fnbool BCRYPT_SUCCESS(NTSTATUS Status) @nogc nothrow pure @safe
fnvoid BCRYPT_INIT_AUTH_MODE_INFO(ref BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO _AUTH_INFO_STRUCT_) @nogc nothrow pure @safe
fnBCRYPT_INTERFACE_VERSION BCRYPT_MAKE_INTERFACE_VERSION(int major, int minor) @nogc nothrow pure @safe
fnNTSTATUS BCryptOpenAlgorithmProvider(scope BCRYPT_ALG_HANDLE * phAlgorithm, scope LPCWSTR pszAlgId, scope LPCWSTR pszImplementation, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptEnumAlgorithms(ULONG dwAlgOperations, scope ULONG * pAlgCount, scope BCRYPT_ALGORITHM_IDENTIFIER * * ppAlgList, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptEnumProviders(scope LPCWSTR pszAlgId, scope ULONG * pImplCount, scope BCRYPT_PROVIDER_NAME * * ppImplList, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptGetProperty(BCRYPT_HANDLE hObject, scope LPCWSTR pszProperty, scope PUCHAR pbOutput, ULONG cbOutput, scope ULONG * pcbResult, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptSetProperty(BCRYPT_HANDLE hObject, scope LPCWSTR pszProperty, scope PUCHAR pbInput, ULONG cbInput, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptCloseAlgorithmProvider(BCRYPT_ALG_HANDLE hAlgorithm, ULONG dwFlags) extern(Windows) @nogc nothrow
fnVOID BCryptFreeBuffer(PVOID pvBuffer) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptGenerateSymmetricKey(BCRYPT_ALG_HANDLE hAlgorithm, scope BCRYPT_KEY_HANDLE * phKey, scope PUCHAR pbKeyObject, ULONG cbKeyObject, scope PUCHAR pbSecret, ULONG cbSecret, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptGenerateKeyPair(BCRYPT_ALG_HANDLE hAlgorithm, scope BCRYPT_KEY_HANDLE * phKey, ULONG dwLength, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptEncrypt(BCRYPT_KEY_HANDLE hKey, scope PUCHAR pbInput, ULONG cbInput, scope VOID * pPaddingInfo, scope PUCHAR pbIV, ULONG cbIV, scope PUCHAR pbOutput, ULONG cbOutput, scope ULONG * pcbResult, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptDecrypt(BCRYPT_KEY_HANDLE hKey, scope PUCHAR pbInput, ULONG cbInput, scope VOID * pPaddingInfo, scope PUCHAR pbIV, ULONG cbIV, scope PUCHAR pbOutput, ULONG cbOutput, scope ULONG * pcbResult, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptExportKey(BCRYPT_KEY_HANDLE hKey, BCRYPT_KEY_HANDLE hExportKey, scope LPCWSTR pszBlobType, scope PUCHAR pbOutput, ULONG cbOutput, scope ULONG * pcbResult, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptImportKey(BCRYPT_ALG_HANDLE hAlgorithm, BCRYPT_KEY_HANDLE hImportKey, scope LPCWSTR pszBlobType, scope BCRYPT_KEY_HANDLE * phKey, scope PUCHAR pbKeyObject, ULONG cbKeyObject, scope PUCHAR pbInput, ULONG cbInput, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptImportKeyPair(BCRYPT_ALG_HANDLE hAlgorithm, BCRYPT_KEY_HANDLE hImportKey, scope LPCWSTR pszBlobType, scope BCRYPT_KEY_HANDLE * phKey, scope PUCHAR pbInput, ULONG cbInput, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptDuplicateKey(BCRYPT_KEY_HANDLE hKey, scope BCRYPT_KEY_HANDLE * phNewKey, scope PUCHAR pbKeyObject, ULONG cbKeyObject, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptFinalizeKeyPair(BCRYPT_KEY_HANDLE hKey, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptDestroyKey(BCRYPT_KEY_HANDLE hKey) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptDestroySecret(BCRYPT_SECRET_HANDLE hSecret) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptSignHash(BCRYPT_KEY_HANDLE hKey, scope VOID * pPaddingInfo, scope PUCHAR pbInput, ULONG cbInput, scope PUCHAR pbOutput, ULONG cbOutput, scope ULONG * pcbResult, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptVerifySignature(BCRYPT_KEY_HANDLE hKey, scope VOID * pPaddingInfo, scope PUCHAR pbHash, ULONG cbHash, scope PUCHAR pbSignature, ULONG cbSignature, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptSecretAgreement(BCRYPT_KEY_HANDLE hPrivKey, BCRYPT_KEY_HANDLE hPubKey, scope BCRYPT_SECRET_HANDLE * phAgreedSecret, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptDeriveKey(BCRYPT_SECRET_HANDLE hSharedSecret, LPCWSTR pwszKDF, scope BCryptBufferDesc * pParameterList, scope PUCHAR pbDerivedKey, ULONG cbDerivedKey, scope ULONG * pcbResult, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptKeyDerivation(BCRYPT_KEY_HANDLE hKey, scope BCryptBufferDesc * pParameterList, scope PUCHAR pbDerivedKey, ULONG cbDerivedKey, scope ULONG * pcbResult, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptCreateHash(BCRYPT_ALG_HANDLE hAlgorithm, scope BCRYPT_HASH_HANDLE * phHash, scope PUCHAR pbHashObject, ULONG cbHashObject, scope PUCHAR pbSecret, ULONG cbSecret, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptHashData(BCRYPT_HASH_HANDLE hHash, scope PUCHAR pbInput, ULONG cbInput, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptFinishHash(BCRYPT_HASH_HANDLE hHash, scope PUCHAR pbOutput, ULONG cbOutput, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptDuplicateHash(BCRYPT_HASH_HANDLE hHash, scope BCRYPT_HASH_HANDLE * phNewHash, scope PUCHAR pbHashObject, ULONG cbHashObject, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptDestroyHash(BCRYPT_HASH_HANDLE hHash) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptGenRandom(BCRYPT_ALG_HANDLE hAlgorithm, scope PUCHAR pbBuffer, ULONG cbBuffer, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptDeriveKeyCapi(BCRYPT_HASH_HANDLE hHash, BCRYPT_ALG_HANDLE hTargetAlg, scope PUCHAR pbDerivedKey, ULONG cbDerivedKey, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptDeriveKeyPBKDF2(BCRYPT_ALG_HANDLE hPrf, scope PUCHAR pbPassword, ULONG cbPassword, scope PUCHAR pbSalt, ULONG cbSalt, ULONGLONG cIterations, scope PUCHAR pbDerivedKey, ULONG cbDerivedKey, ULONG dwFlags) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptResolveProviders(scope LPCWSTR pszContext, ULONG dwInterface, scope LPCWSTR pszFunction, scope LPCWSTR pszProvider, ULONG dwMode, ULONG dwFlags, scope ULONG * pcbBuffer, scope PCRYPT_PROVIDER_REFS * ppBuffer) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptGetFipsAlgorithmMode(scope BOOLEAN * pfEnabled) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptQueryProviderRegistration(scope LPCWSTR pszProvider, ULONG dwMode, ULONG dwInterface, scope ULONG * pcbBuffer, scope PCRYPT_PROVIDER_REG * ppBuffer) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptEnumRegisteredProviders(scope ULONG * pcbBuffer, scope PCRYPT_PROVIDERS * ppBuffer) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptCreateContext(ULONG dwTable, scope LPCWSTR pszContext, PCRYPT_CONTEXT_CONFIG pConfig) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptDeleteContext(ULONG dwTable, scope LPCWSTR pszContext) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptEnumContexts(ULONG dwTable, scope ULONG * pcbBuffer, scope PCRYPT_CONTEXTS * ppBuffer) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptConfigureContext(ULONG dwTable, scope LPCWSTR pszContext, PCRYPT_CONTEXT_CONFIG pConfig) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptQueryContextConfiguration(ULONG dwTable, scope LPCWSTR pszContext, scope ULONG * pcbBuffer, scope PCRYPT_CONTEXT_CONFIG * ppBuffer) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptAddContextFunction(ULONG dwTable, scope LPCWSTR pszContext, ULONG dwInterface, scope LPCWSTR pszFunction, ULONG dwPosition) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptRemoveContextFunction(ULONG dwTable, scope LPCWSTR pszContext, ULONG dwInterface, scope LPCWSTR pszFunction) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptEnumContextFunctions(ULONG dwTable, scope LPCWSTR pszContext, ULONG dwInterface, scope ULONG * pcbBuffer, scope PCRYPT_CONTEXT_FUNCTIONS * ppBuffer) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptConfigureContextFunction(ULONG dwTable, scope LPCWSTR pszContext, ULONG dwInterface, scope LPCWSTR pszFunction, PCRYPT_CONTEXT_FUNCTION_CONFIG pConfig) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptQueryContextFunctionConfiguration(ULONG dwTable, scope LPCWSTR pszContext, ULONG dwInterface, scope LPCWSTR pszFunction, scope ULONG * pcbBuffer, scope PCRYPT_CONTEXT_FUNCTION_CONFIG * ppBuffer) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptEnumContextFunctionProviders(ULONG dwTable, scope LPCWSTR pszContext, ULONG dwInterface, scope LPCWSTR pszFunction, scope ULONG * pcbBuffer, scope PCRYPT_CONTEXT_FUNCTION_PROVIDERS * ppBuffer) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptSetContextFunctionProperty(ULONG dwTable, scope LPCWSTR pszContext, ULONG dwInterface, scope LPCWSTR pszFunction, LPCWSTR pszProperty, ULONG cbValue, scope PUCHAR pbValue) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptQueryContextFunctionProperty(ULONG dwTable, scope LPCWSTR pszContext, ULONG dwInterface, scope LPCWSTR pszFunction, LPCWSTR pszProperty, ULONG * pcbValue, scope PUCHAR * ppbValue) extern(Windows) @nogc nothrow
fnNTSTATUS BCryptRegisterConfigChangeNotify(scope HANDLE * phEvent) extern(Windows) @nogc nothrow
deprecated
fnNTSTATUS BCryptUnregisterConfigChangeNotify(HANDLE hEvent) extern(Windows) @nogc nothrow

Variables 12

enumvarBCRYPT_OBJECT_ALIGNMENT = 16
enumvarKDF_USE_SECRET_AS_HMAC_KEY_FLAG = 1
enumvarBCRYPT_AUTHENTICATED_CIPHER_MODE_INFO_VERSION = 1
enumvarBCRYPT_PROV_DISPATCH = 0x00000001
enumvarBCRYPT_BLOCK_PADDING = 0x00000001
enumvarBCRYPTBUFFER_VERSION = 0
enumvarBCRYPT_RSAFULLPRIVATE_BLOB = "RSAFULLPRIVATEBLOB"w
enumvarBCRYPT_RSAFULLPRIVATE_MAGIC = 0x33415352
enumvarTLS_13_PRE_SHARED_KEY = "TLS13PRESHAREDKEY"w
enumvarBCRYPT_NO_KEY_VALIDATION = 0x00000008
enumvarCRYPT_OVERWRITE = 0x00000001
enumvarCRYPT_DEFAULT_CONTEXT = "Default"w