Lines Matching +full:fast +full:- +full:read
1 /*-
4 * Copyright (c) 2000-2015 Mark R V Murray
54 #include <crypto/rijndael/rijndael-api-fst.h>
100 /* 1 to let the kernel thread run, 0 to terminate, -1 to mark completion */
129 /* Round-robin destination cache. */
174 p_random_alg_context->ra_event_processor(event); in random_harvestq_fast_process_event()
195 if (!--maxloop) in random_kthread()
199 /* XXX: FIX!! Increase the high-performance data rate? Need some measurements first. */ in random_kthread()
207 tsleep_sbt(&harvest_context.hc_kthread_proc, 0, "-", in random_kthread()
210 random_kthread_control = -1; in random_kthread()
228 * Run through all fast sources reading entropy for the given
244 * Evenly-ish distribute pool population across the second based on how in random_sources_feed()
253 npools = howmany(p_random_alg_context->ra_poolcount, RANDOM_KTHREAD_HZ); in random_sources_feed()
255 /*- in random_sources_feed()
258 * available from "fast" entropy sources this will allow us to finish in random_sources_feed()
267 * a different PRNG, larger pools, or fast entropy sources which are in random_sources_feed()
273 if (!p_random_alg_context->ra_seeded()) in random_sources_feed()
274 npools = howmany(p_random_alg_context->ra_poolcount * in random_sources_feed()
279 * to the system-wide RNG. in random_sources_feed()
285 n = rrs->rrs_source->rs_read(entropy, sizeof(entropy)); in random_sources_feed()
300 random_harvest_direct(entropy, n, rrs->rrs_source->rs_source); in random_sources_feed()
313 (((1 << ENTROPYSOURCE) - 1) & (-1UL << RANDOM_PURE_START)) | in random_check_uint_harvestmask()
321 if (error != 0 || req->newptr == NULL) in random_check_uint_harvestmask()
349 for (i = ENTROPYSOURCE - 1; i >= 0; i--) in random_print_harvestmask()
405 for (i = ENTROPYSOURCE - 1; i >= 0; i--) { in random_print_harvestmask_symbolic()
431 (((1 << (RANDOM_ENVIRONMENTAL_END + 1)) - 1) & in random_harvestq_init()
469 * Subroutine to search for known loader-loaded files in memory and feed them
504 * and use it to pre-charge the entropy harvest queue. in random_harvestq_prime()
509 printf("random: read %zu bytes from preloaded cache\n", in random_harvestq_prime()
517 printf("random: read %zu bytes from platform bootloader\n", in random_harvestq_prime()
537 /*-
540 * This is supposed to be fast; do not do anything slow in here!
542 * high-rate data here. "High-rate" is defined as a data source
543 * that will usually cause lots of failures of the "Lockless read"
544 * check a few lines below. This includes the "always-on" sources
549 * read which can be quite expensive.
563 event->he_somecounter = (uint32_t)get_cyclecount(); in random_harvest_queue_()
564 event->he_source = origin; in random_harvest_queue_()
565 event->he_destination = harvest_context.hc_destination[origin]++; in random_harvest_queue_()
566 if (size <= sizeof(event->he_entropy)) { in random_harvest_queue_()
567 event->he_size = size; in random_harvest_queue_()
568 memcpy(event->he_entropy, entropy, size); in random_harvest_queue_()
572 event->he_size = sizeof(event->he_entropy[0]); in random_harvest_queue_()
573 event->he_entropy[0] = jenkins_hash(entropy, size, (uint32_t)(uintptr_t)event); in random_harvest_queue_()
580 /*-
581 * Entropy harvesting fast routine.
583 * This is supposed to be very fast; do not do anything slow in here!
584 * This is the right place for high-rate harvested data.
596 /*-
599 * This is not supposed to be fast, but will only be used during
639 rrs->rrs_source = rsource; in random_source_register()
641 random_harvest_register_source(rsource->rs_source); in random_source_register()
643 printf("random: registering fast source %s\n", rsource->rs_ident); in random_source_register()
657 random_harvest_deregister_source(rsource->rs_source); in random_source_deregister()
661 if (rrs->rrs_source == rsource) { in random_source_deregister()
689 sbuf_cat(&sbuf, rrs->rrs_source->rs_ident); in random_source_handler()
699 "List of active fast entropy sources.");