[libcxx-commits] [libcxx] 6e2c6c9 - [libcxx] random_device, specify optimal entropy properties for all OS's using arc4random()

Brad Smith via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 28 19:44:14 PDT 2022


Author: Brad Smith
Date: 2022-03-28T22:43:11-04:00
New Revision: 6e2c6c9def394c79a65bb216ac3d5261d39cc960

URL: https://github.com/llvm/llvm-project/commit/6e2c6c9def394c79a65bb216ac3d5261d39cc960
DIFF: https://github.com/llvm/llvm-project/commit/6e2c6c9def394c79a65bb216ac3d5261d39cc960.diff

LOG: [libcxx] random_device, specify optimal entropy properties for all OS's using arc4random()

Reviewed By: ldionne

Differential Revision: https://reviews.llvm.org/D122522

Added: 
    

Modified: 
    libcxx/src/random.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/src/random.cpp b/libcxx/src/random.cpp
index 466b0157722f3..38732462cf5df 100644
--- a/libcxx/src/random.cpp
+++ b/libcxx/src/random.cpp
@@ -210,7 +210,7 @@ random_device::entropy() const noexcept
     return std::numeric_limits<result_type>::digits;
 
   return ent;
-#elif defined(__OpenBSD__) || defined(_LIBCPP_USING_FUCHSIA_CPRNG)
+#elif defined(_LIBCPP_USING_ARC4_RANDOM) || defined(_LIBCPP_USING_FUCHSIA_CPRNG)
   return std::numeric_limits<result_type>::digits;
 #else
   return 0;


        


More information about the libcxx-commits mailing list