Skip to content

Commit 2b6c6e3

Browse files
brooniezx2c4
authored andcommitted
random: document add_hwgenerator_randomness() with other input functions
The section at the top of random.c which documents the input functions available does not document add_hwgenerator_randomness() which might lead a reader to overlook it. Add a brief note about it. Signed-off-by: Mark Brown <[email protected]> [Jason: reorganize position of function in doc comment and also document add_bootloader_randomness() while we're at it.] Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent 9bafaa9 commit 2b6c6e3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

drivers/char/random.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,9 @@
202202
* unsigned int value);
203203
* void add_interrupt_randomness(int irq, int irq_flags);
204204
* void add_disk_randomness(struct gendisk *disk);
205+
* void add_hwgenerator_randomness(const char *buffer, size_t count,
206+
* size_t entropy);
207+
* void add_bootloader_randomness(const void *buf, unsigned int size);
205208
*
206209
* add_device_randomness() is for adding data to the random pool that
207210
* is likely to differ between two devices (or possibly even per boot).
@@ -228,6 +231,14 @@
228231
* particular randomness source. They do this by keeping track of the
229232
* first and second order deltas of the event timings.
230233
*
234+
* add_hwgenerator_randomness() is for true hardware RNGs, and will credit
235+
* entropy as specified by the caller. If the entropy pool is full it will
236+
* block until more entropy is needed.
237+
*
238+
* add_bootloader_randomness() is the same as add_hwgenerator_randomness() or
239+
* add_device_randomness(), depending on whether or not the configuration
240+
* option CONFIG_RANDOM_TRUST_BOOTLOADER is set.
241+
*
231242
* Ensuring unpredictability at system startup
232243
* ============================================
233244
*

0 commit comments

Comments
 (0)