getrandom is the base implementation for getentropy on Linux. It is also
available in the form of a syscall, which can be called directly on systems with
glibc versions older than 2.25 which don't yet provide wrappers for getrandom or
getentropy but have a recent enough Linux kernel (for example, Debian Stretch).
On systems other than Linux (e.g. Solaris) getentropy is documented as a
source for initialization of a user-space PRNG instead of a direct source
for random data. Since we use the random data directly to initialize UUIDs,
using getrandom on other platforms, where available, would be more preferable
than getentropy. Unfortunately, the only other platform that is known to support
both getentropy and getrandom (Solaris) documents getrandom to return 0
on error, which is a valid return value on Linux. It's not clear if this is
a documentation error or a true incompatibility, and I have no way to test,
so do not use getrandom on Solaris for now. For this reason (and in case
if it is also used on some other platforms) getentropy backend is still
preserved.
For running tests in the CI on the getentropy backend added the
BOOST_UUID_RANDOM_PROVIDER_DISABLE_GETRANDOM macro, which will disable getrandom
if one is detected. Currently, the macro is only used for tests on Linux.
operating-system provided entropy as it is more secure and
faster for the typical use case of generating one uuid at
a time.
This is a breaking change for anyone passing a mt19937
into one of the explicit constructors of random_generator,
which would be quite rare.
Changed the default random provider on Windows to use BCrypt
where available, falling back to Wincrypt when necessary or
when explicitly requested through a macro.
Provide a new random_generator_mt19937 type definition for
use cases where a large number of uuids need to be created
with high performance. This is equivalent to the previous
definition of random_generator.
Provide a random generation benchmark test showing the
cutoff where the mt19937-based generator will outperform the
standard generator based on wall time.
Removed template specialization for boost::random::random_device
so that any UniformRandomNumberGenerator can be used properly
with random_generator.
Replaced the seed_rng detail implementation (which had a number
of flaws) with a replacement header-only random_provider
implementation.
Note: entropy generation errors will cause an entropy_error
to be thrown from random_generator. The previous implementation
ignored errors and silently failed.
Added internal support for entropy generation on cloudabi
platform leveraging the new random_provider implementation.
Added internal support for Universal Windows Platform (UWP)
development leveraging the new random_provider implementation.
Added internal support for getentropy() on Linux and OpenBSD
if certain requirements are met.
This fixes#24
This closes#53
throw std::runtime_error like it always had before
therefore removing a breaking change before release
remove one unnecessary code branch in string_generator
and provide backwards compatibility for sha1, and also added
md5 to complete the RFC 4122 spec implementation
as such, boost::uuids::name_generator is deprecated, however
still defined to use the same implementation in previous boost
releases, and name_generator_sha1 as well as name_generator_md5
now exist, in preparation for whatever will replace sha1.
to properly test the new header structure, I took the bjam
rule from winapi to isolate each header as an include and make sure
it has no dependencies on other headers to be included first,
and was able to remove a few test files that became unnecessary.
This fixes#26