Lines Matching refs:entropy_data

92 typedef struct entropy_data {  struct
155 static entropy_data_t entropy_data = { argument
209 lck_grp_init(&entropy_data.lock_group, "entropy-data", LCK_GRP_ATTR_NULL); in entropy_init()
210 lck_mtx_init(&entropy_data.mutex, &entropy_data.lock_group, LCK_ATTR_NULL); in entropy_init()
383 entropy_health_test_t *t = &entropy_data.repetition_count_test; in repetition_count_test()
427 entropy_health_test_t *t = &entropy_data.adaptive_proportion_test; in adaptive_proportion_test()
433 uint32_t index = (entropy_data.total_sample_count + offset) & ADAPTIVE_PROPORTION_INDEX_MASK; in adaptive_proportion_test()
498 if (!lck_mtx_try_lock(&entropy_data.mutex)) { in entropy_provide()
505 if (__improbable(!entropy_data.sha256_ctx_init)) { in entropy_provide()
506 SHA256_Init(&entropy_data.sha256_ctx); in entropy_provide()
507 entropy_data.sha256_ctx_init = true; in entropy_provide()
524 …ount = entropy_filter(cpu_sample_count, e->samples, ENTROPY_MAX_FILTER_COUNT, entropy_data.filter); in entropy_provide()
534 …= entropy_health_test(cpu_sample_count, e->samples, ENTROPY_MAX_FILTER_COUNT, entropy_data.filter); in entropy_provide()
541 entropy_data.total_sample_count += filtered_sample_count; in entropy_provide()
542 SHA256_Update(&entropy_data.sha256_ctx, e->samples, cpu_sample_count * sizeof(e->samples[0])); in entropy_provide()
554 entropy_data.startup_sample_count = entropy_data.total_sample_count; in entropy_provide()
555 entropy_data.read_sample_count = entropy_data.total_sample_count; in entropy_provide()
563 if (__improbable((entropy_data.total_sample_count - entropy_data.startup_sample_count) < 1024)) { in entropy_provide()
570 int32_t n = (int32_t)(entropy_data.total_sample_count - entropy_data.read_sample_count); in entropy_provide()
579 SHA256_Final(entropy, &entropy_data.sha256_ctx); in entropy_provide()
580 SHA256_Init(&entropy_data.sha256_ctx); in entropy_provide()
581 entropy_data.read_sample_count = entropy_data.total_sample_count; in entropy_provide()
587 lck_mtx_unlock(&entropy_data.mutex); in entropy_provide()