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

Tom Stellard via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Apr 1 22:05:16 PDT 2022


Author: Brad Smith
Date: 2022-04-01T22:03:51-07:00
New Revision: b69247dcbd80196af7f3b3942a51be3f2f82023b

URL: https://github.com/llvm/llvm-project/commit/b69247dcbd80196af7f3b3942a51be3f2f82023b
DIFF: https://github.com/llvm/llvm-project/commit/b69247dcbd80196af7f3b3942a51be3f2f82023b.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

(cherry picked from commit 6e2c6c9def394c79a65bb216ac3d5261d39cc960)

Added: 
    

Modified: 
    libcxx/src/random.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/src/random.cpp b/libcxx/src/random.cpp
index 6472a8dbcba3e..146b7c56bdebf 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 llvm-branch-commits mailing list