Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:29:33

0001 //
0002 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
0003 //
0004 // Distributed under the Boost Software License, Version 1.0. (See accompanying
0005 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 //
0007 // Official repository: https://github.com/boostorg/beast
0008 //
0009 
0010 #ifndef BOOST_BEAST_WEBSOCKET_DETAIL_PRNG_HPP
0011 #define BOOST_BEAST_WEBSOCKET_DETAIL_PRNG_HPP
0012 
0013 #include <boost/beast/core/detail/config.hpp>
0014 #include <boost/config.hpp>
0015 #include <cstdint>
0016 #include <random>
0017 
0018 namespace boost {
0019 namespace beast {
0020 namespace websocket {
0021 namespace detail {
0022 
0023 using generator = std::uint32_t(*)();
0024 
0025 //------------------------------------------------------------------------------
0026 
0027 // Manually seed the prngs, must be called
0028 // before acquiring a prng for the first time.
0029 //
0030 BOOST_BEAST_DECL
0031 std::uint32_t const*
0032 prng_seed(std::seed_seq* ss = nullptr);
0033 
0034 // Acquire a PRNG using the TLS implementation if it
0035 // is available, otherwise using the no-TLS implementation.
0036 //
0037 BOOST_BEAST_DECL
0038 generator
0039 make_prng(bool secure);
0040 
0041 } // detail
0042 } // websocket
0043 } // beast
0044 } // boost
0045 
0046 #ifdef BOOST_BEAST_HEADER_ONLY
0047 #include <boost/beast/websocket/detail/prng.ipp>
0048 #endif
0049 
0050 #endif