2008-09-14 11:32:55 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2007 Francois Gouget
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2012-06-21 18:25:41 +00:00
|
|
|
#ifndef __WINE_BCRYPT_H
|
|
|
|
#define __WINE_BCRYPT_H
|
2008-09-14 11:32:55 +00:00
|
|
|
|
|
|
|
#ifndef WINAPI
|
|
|
|
#define WINAPI __stdcall
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef IN
|
|
|
|
#define IN
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef OUT
|
|
|
|
#define OUT
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef OPTIONAL
|
|
|
|
#define OPTIONAL
|
|
|
|
#endif
|
|
|
|
|
2014-04-22 11:36:10 +00:00
|
|
|
#ifndef _NTDEF_
|
|
|
|
typedef _Return_type_success_(return >= 0) LONG NTSTATUS;
|
2014-10-13 10:53:58 +00:00
|
|
|
typedef NTSTATUS *PNTSTATUS;
|
2014-04-22 11:36:10 +00:00
|
|
|
#endif
|
|
|
|
|
2016-03-05 22:40:18 +00:00
|
|
|
#define BCRYPT_ALGORITHM_NAME L"AlgorithmName"
|
|
|
|
#define BCRYPT_AUTH_TAG_LENGTH L"AuthTagLength"
|
|
|
|
#define BCRYPT_BLOCK_LENGTH L"BlockLength"
|
|
|
|
#define BCRYPT_BLOCK_SIZE_LIST L"BlockSizeList"
|
|
|
|
#define BCRYPT_CHAINING_MODE L"ChainingMode"
|
|
|
|
#define BCRYPT_EFFECTIVE_KEY_LENGTH L"EffectiveKeyLength"
|
|
|
|
#define BCRYPT_HASH_BLOCK_LENGTH L"HashBlockLength"
|
|
|
|
#define BCRYPT_HASH_LENGTH L"HashDigestLength"
|
|
|
|
#define BCRYPT_HASH_OID_LIST L"HashOIDList"
|
2016-03-05 22:46:54 +00:00
|
|
|
#define BCRYPT_KEY_LENGTH L"KeyLength"
|
2016-03-05 22:40:18 +00:00
|
|
|
#define BCRYPT_KEY_LENGTHS L"KeyLengths"
|
|
|
|
#define BCRYPT_KEY_OBJECT_LENGTH L"KeyObjectLength"
|
|
|
|
#define BCRYPT_KEY_STRENGTH L"KeyStrength"
|
|
|
|
#define BCRYPT_OBJECT_LENGTH L"ObjectLength"
|
|
|
|
#define BCRYPT_PADDING_SCHEMES L"PaddingSchemes"
|
|
|
|
#define BCRYPT_PROVIDER_HANDLE L"ProviderHandle"
|
|
|
|
#define BCRYPT_SIGNATURE_LENGTH L"SignatureLength"
|
2016-03-01 12:24:32 +00:00
|
|
|
|
2016-03-05 22:40:18 +00:00
|
|
|
#define MS_PRIMITIVE_PROVIDER L"Microsoft Primitive Provider"
|
|
|
|
#define MS_PLATFORM_CRYPTO_PROVIDER L"Microsoft Platform Crypto Provider"
|
2016-03-01 12:24:32 +00:00
|
|
|
|
2016-11-17 22:07:42 +00:00
|
|
|
#define BCRYPT_MD5_ALGORITHM L"MD5"
|
|
|
|
#define BCRYPT_RNG_ALGORITHM L"RNG"
|
2016-03-05 22:40:18 +00:00
|
|
|
#define BCRYPT_SHA1_ALGORITHM L"SHA1"
|
|
|
|
#define BCRYPT_SHA256_ALGORITHM L"SHA256"
|
|
|
|
#define BCRYPT_SHA384_ALGORITHM L"SHA384"
|
|
|
|
#define BCRYPT_SHA512_ALGORITHM L"SHA512"
|
2016-03-01 12:24:32 +00:00
|
|
|
|
2012-01-23 13:30:23 +00:00
|
|
|
typedef struct _BCRYPT_ALGORITHM_IDENTIFIER
|
|
|
|
{
|
|
|
|
LPWSTR pszName;
|
|
|
|
ULONG dwClass;
|
|
|
|
ULONG dwFlags;
|
|
|
|
} BCRYPT_ALGORITHM_IDENTIFIER;
|
|
|
|
|
2014-04-22 11:36:10 +00:00
|
|
|
typedef PVOID BCRYPT_ALG_HANDLE;
|
2015-03-18 15:42:53 +00:00
|
|
|
typedef PVOID BCRYPT_HANDLE;
|
2015-11-17 16:15:10 +00:00
|
|
|
typedef PVOID BCRYPT_HASH_HANDLE;
|
2014-04-22 11:36:10 +00:00
|
|
|
|
|
|
|
#define BCRYPT_RNG_USE_ENTROPY_IN_BUFFER 0x00000001
|
|
|
|
#define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002
|
2016-11-17 22:07:42 +00:00
|
|
|
#define BCRYPT_ALG_HANDLE_HMAC_FLAG 0x00000008
|
2014-04-22 11:36:10 +00:00
|
|
|
|
2016-03-01 12:24:32 +00:00
|
|
|
NTSTATUS WINAPI BCryptCloseAlgorithmProvider(BCRYPT_ALG_HANDLE, ULONG);
|
|
|
|
NTSTATUS WINAPI BCryptCreateHash(BCRYPT_ALG_HANDLE, BCRYPT_HASH_HANDLE *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG);
|
|
|
|
NTSTATUS WINAPI BCryptDestroyHash(BCRYPT_HASH_HANDLE);
|
|
|
|
NTSTATUS WINAPI BCryptEnumAlgorithms(ULONG, ULONG *, BCRYPT_ALGORITHM_IDENTIFIER **, ULONG);
|
|
|
|
NTSTATUS WINAPI BCryptFinishHash(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
|
|
|
|
NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, ULONG);
|
|
|
|
NTSTATUS WINAPI BCryptGetFipsAlgorithmMode(BOOLEAN *);
|
|
|
|
NTSTATUS WINAPI BCryptGetProperty(BCRYPT_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG *, ULONG);
|
2016-11-17 22:07:42 +00:00
|
|
|
NTSTATUS WINAPI BCryptHash(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, PUCHAR, ULONG, PUCHAR, ULONG);
|
2016-03-01 12:24:32 +00:00
|
|
|
NTSTATUS WINAPI BCryptHashData(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
|
|
|
|
NTSTATUS WINAPI BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE *, LPCWSTR, LPCWSTR, ULONG);
|
|
|
|
|
2012-06-21 18:25:41 +00:00
|
|
|
#endif /* __WINE_BCRYPT_H */
|