Lines Matching defs:entropy
128 # error You do not have support for any sources of high quality entropy \
744 /* Obtain entropy on Linux 3.17+ */
776 /* Extract entropy from /dev/urandom */
839 /* Obtain entropy on Windows using the rand_s() function which
885 /* Microseconds time is <20 bits entropy */
893 ENTROPY_DEBUG(const char *label, unsigned long entropy) {
896 (int)sizeof(entropy) * 2, entropy, (unsigned long)sizeof(entropy));
898 return entropy;
903 unsigned long entropy;
908 arc4random_buf(&entropy, sizeof(entropy));
909 return ENTROPY_DEBUG("arc4random_buf", entropy);
911 writeRandomBytes_arc4random((void *)&entropy, sizeof(entropy));
912 return ENTROPY_DEBUG("arc4random", entropy);
916 if (writeRandomBytes_rand_s((void *)&entropy, sizeof(entropy))) {
917 return ENTROPY_DEBUG("rand_s", entropy);
920 if (writeRandomBytes_getrandom_nonblock((void *)&entropy, sizeof(entropy))) {
921 return ENTROPY_DEBUG("getrandom", entropy);
925 if (writeRandomBytes_dev_urandom((void *)&entropy, sizeof(entropy))) {
926 return ENTROPY_DEBUG("/dev/urandom", entropy);
931 /* Process ID is 0 bits entropy if attacker has local access */
932 entropy = gather_time_entropy() ^ getpid();
936 return ENTROPY_DEBUG("fallback(4)", entropy * 2147483647);
939 entropy * (unsigned long)2305843009213693951ULL);