]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/winapi/bcrypt.hpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / boost / winapi / bcrypt.hpp
CommitLineData
b32b8144
FG
1/*
2 * Copyright 2017 James E. King, III
3 *
4 * Distributed under the Boost Software License, Version 1.0.
5 * See http://www.boost.org/LICENSE_1_0.txt
6 */
7
8#ifndef BOOST_WINAPI_BCRYPT_HPP_INCLUDED_
9#define BOOST_WINAPI_BCRYPT_HPP_INCLUDED_
10
11#include <boost/winapi/basic_types.hpp>
12
13#ifdef BOOST_HAS_PRAGMA_ONCE
14#pragma once
15#endif
16
92f5a8d4 17#if BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
b32b8144
FG
18
19#if BOOST_WINAPI_PARTITION_APP_SYSTEM
20
21#if defined(BOOST_USE_WINDOWS_H)
22
23#include <bcrypt.h>
24
25namespace boost { namespace winapi {
26typedef ::BCRYPT_ALG_HANDLE BCRYPT_ALG_HANDLE_;
27}}
28
29#else // defined(BOOST_USE_WINDOWS_H)
30
31namespace boost { namespace winapi {
32typedef PVOID_ BCRYPT_ALG_HANDLE_;
33}}
34
35extern "C" {
36
92f5a8d4 37boost::winapi::NTSTATUS_ BOOST_WINAPI_WINAPI_CC
b32b8144
FG
38BCryptCloseAlgorithmProvider(
39 boost::winapi::BCRYPT_ALG_HANDLE_ hAlgorithm,
40 boost::winapi::ULONG_ dwFlags
41);
42
92f5a8d4 43boost::winapi::NTSTATUS_ BOOST_WINAPI_WINAPI_CC
b32b8144
FG
44BCryptGenRandom(
45 boost::winapi::BCRYPT_ALG_HANDLE_ hAlgorithm,
46 boost::winapi::PUCHAR_ pbBuffer,
47 boost::winapi::ULONG_ cbBuffer,
48 boost::winapi::ULONG_ dwFlags
49);
50
92f5a8d4 51boost::winapi::NTSTATUS_ BOOST_WINAPI_WINAPI_CC
b32b8144
FG
52BCryptOpenAlgorithmProvider(
53 boost::winapi::BCRYPT_ALG_HANDLE_ *phAlgorithm,
54 boost::winapi::LPCWSTR_ pszAlgId,
55 boost::winapi::LPCWSTR_ pszImplementation,
56 boost::winapi::DWORD_ dwFlags
57);
58
59} // extern "C"
60
61#endif // defined(BOOST_USE_WINDOWS_H)
62
63namespace boost {
64namespace winapi {
65
66#if defined(BOOST_USE_WINDOWS_H)
67const WCHAR_ BCRYPT_RNG_ALGORITHM_[] = BCRYPT_RNG_ALGORITHM;
68#else
69const WCHAR_ BCRYPT_RNG_ALGORITHM_[] = L"RNG";
70#endif
71
72using ::BCryptCloseAlgorithmProvider;
73using ::BCryptGenRandom;
74using ::BCryptOpenAlgorithmProvider;
75
76} // winapi
77} // boost
78
79#endif // BOOST_WINAPI_PARTITION_APP_SYSTEM
80
92f5a8d4 81#endif // BOOST_USE_WINAPI_VERSION >= BOOST_WINAPI_VERSION_WIN6
b32b8144
FG
82
83#endif // BOOST_WINAPI_BCRYPT_HPP_INCLUDED_