Home
last modified time | relevance | path

Searched refs:bytes_needed (Results 1 – 9 of 9) sorted by relevance

/openssl/providers/implementations/rands/seeding/
H A Drand_win.c53 size_t bytes_needed; in ossl_pool_acquire_entropy() local
70 bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/); in ossl_pool_acquire_entropy()
71 buffer = ossl_rand_pool_add_begin(pool, bytes_needed); in ossl_pool_acquire_entropy()
74 if (BCryptGenRandom(NULL, buffer, bytes_needed, in ossl_pool_acquire_entropy()
76 bytes = bytes_needed; in ossl_pool_acquire_entropy()
85 buffer = ossl_rand_pool_add_begin(pool, bytes_needed); in ossl_pool_acquire_entropy()
91 if (CryptGenRandom(hProvider, bytes_needed, buffer) != 0) in ossl_pool_acquire_entropy()
92 bytes = bytes_needed; in ossl_pool_acquire_entropy()
104 buffer = ossl_rand_pool_add_begin(pool, bytes_needed); in ossl_pool_acquire_entropy()
111 if (CryptGenRandom(hProvider, bytes_needed, buffer) != 0) in ossl_pool_acquire_entropy()
[all …]
H A Drand_cpu_arm64.c35 size_t bytes_needed; in ossl_prov_acquire_entropy_from_cpu() local
38 bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/); in ossl_prov_acquire_entropy_from_cpu()
39 if (bytes_needed > 0) { in ossl_prov_acquire_entropy_from_cpu()
40 buffer = ossl_rand_pool_add_begin(pool, bytes_needed); in ossl_prov_acquire_entropy_from_cpu()
43 if (get_hardware_random_value(buffer, bytes_needed) == bytes_needed) in ossl_prov_acquire_entropy_from_cpu()
44 ossl_rand_pool_add_end(pool, bytes_needed, 8 * bytes_needed); in ossl_prov_acquire_entropy_from_cpu()
H A Drand_cpu_x86.c40 size_t bytes_needed; in ossl_prov_acquire_entropy_from_cpu() local
43 bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/); in ossl_prov_acquire_entropy_from_cpu()
44 if (bytes_needed > 0) { in ossl_prov_acquire_entropy_from_cpu()
45 buffer = ossl_rand_pool_add_begin(pool, bytes_needed); in ossl_prov_acquire_entropy_from_cpu()
48 if (get_hardware_random_value(buffer, bytes_needed) == bytes_needed) { in ossl_prov_acquire_entropy_from_cpu()
49 ossl_rand_pool_add_end(pool, bytes_needed, 8 * bytes_needed); in ossl_prov_acquire_entropy_from_cpu()
H A Drand_unix.c143 size_t bytes_needed; in ossl_pool_acquire_entropy() local
156 for (i = 0; i < bytes_needed; i++) { in ossl_pool_acquire_entropy()
633 size_t bytes_needed; in ossl_pool_acquire_entropy()
640 while (bytes_needed != 0 && attempts-- > 0) { in ossl_pool_acquire_entropy()
645 bytes_needed -= bytes; in ossl_pool_acquire_entropy()
659 size_t bytes_needed; in ossl_pool_acquire_entropy()
676 bytes = read(fd, buffer, bytes_needed); in ossl_pool_acquire_entropy()
680 bytes_needed -= bytes; in ossl_pool_acquire_entropy()
712 size_t bytes_needed; in ossl_pool_acquire_entropy()
724 if (num == (int)bytes_needed) in ossl_pool_acquire_entropy()
[all …]
H A Drand_vxworks.c105 size_t bytes_needed; in ossl_pool_acquire_entropy() local
107 bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /*entropy_factor*/); in ossl_pool_acquire_entropy()
108 if (bytes_needed > 0) { in ossl_pool_acquire_entropy()
113 buffer = ossl_rand_pool_add_begin(pool, bytes_needed); in ossl_pool_acquire_entropy()
119 result = randBytes(buffer, bytes_needed); in ossl_pool_acquire_entropy()
121 ossl_rand_pool_add_end(pool, bytes_needed, 8 * bytes_needed); in ossl_pool_acquire_entropy()
H A Drand_vms.c366 size_t bytes_needed = ossl_rand_pool_bytes_needed(pool, ENTROPY_FACTOR); in data_collect_method() local
459 if (!ossl_assert(total_length >= bytes_needed)) { in data_collect_method()
462 bytes_needed, total_length); in data_collect_method()
508 size_t bytes_needed; in get_entropy_method() local
512 for (bytes_needed = ossl_rand_pool_bytes_needed(pool, 1); in get_entropy_method()
513 bytes_needed > 0; in get_entropy_method()
514 bytes_needed -= bytes_to_get) { in get_entropy_method()
516 bytes_needed > sizeof(buffer) ? sizeof(buffer) : bytes_needed; in get_entropy_method()
/openssl/crypto/rand/
H A Drand_pool.c240 size_t bytes_needed; in ossl_rand_pool_bytes_needed() local
248 bytes_needed = ENTROPY_TO_BYTES(entropy_needed, entropy_factor); in ossl_rand_pool_bytes_needed()
250 if (bytes_needed > pool->max_len - pool->len) { in ossl_rand_pool_bytes_needed()
255 entropy_factor, entropy_needed, bytes_needed, in ossl_rand_pool_bytes_needed()
261 bytes_needed < pool->min_len - pool->len) in ossl_rand_pool_bytes_needed()
263 bytes_needed = pool->min_len - pool->len; in ossl_rand_pool_bytes_needed()
277 if (!rand_pool_grow(pool, bytes_needed)) { in ossl_rand_pool_bytes_needed()
283 return bytes_needed; in ossl_rand_pool_bytes_needed()
/openssl/providers/implementations/rands/
H A Dseed_src_jitter.c63 size_t bytes_needed; in ossl_prov_acquire_entropy_from_jitter() local
66 bytes_needed = ossl_rand_pool_bytes_needed(pool, 1 /* entropy_factor */); in ossl_prov_acquire_entropy_from_jitter()
67 if (bytes_needed > 0) { in ossl_prov_acquire_entropy_from_jitter()
68 buffer = ossl_rand_pool_add_begin(pool, bytes_needed); in ossl_prov_acquire_entropy_from_jitter()
71 if (get_jitter_random_value(s, buffer, bytes_needed) == bytes_needed) { in ossl_prov_acquire_entropy_from_jitter()
72 ossl_rand_pool_add_end(pool, bytes_needed, 8 * bytes_needed); in ossl_prov_acquire_entropy_from_jitter()
H A Ddrbg.c150 size_t bytes_needed; in ossl_drbg_get_seed() local
154 bytes_needed = entropy >= 0 ? (entropy + 7) / 8 : 0; in ossl_drbg_get_seed()
155 if (bytes_needed < min_len) in ossl_drbg_get_seed()
156 bytes_needed = min_len; in ossl_drbg_get_seed()
157 if (bytes_needed > max_len) in ossl_drbg_get_seed()
158 bytes_needed = max_len; in ossl_drbg_get_seed()
161 buffer = OPENSSL_secure_malloc(bytes_needed); in ossl_drbg_get_seed()
174 if (!ossl_prov_drbg_generate(drbg, buffer, bytes_needed, in ossl_drbg_get_seed()
177 OPENSSL_secure_clear_free(buffer, bytes_needed); in ossl_drbg_get_seed()
182 return bytes_needed; in ossl_drbg_get_seed()

Completed in 25 milliseconds