random: Clarify the semantics of TEST_RANDOM_GENERATOR
The `TEST_RANDOM_GENERATOR` Kconfig symbol indicates that a non-random number generator (i.e. a random number generator that is not truly random) is _allowed_ to be used for testing purposes, and not necessarily that a non-random number generator is _selected_ -- that is indicated by the `RNG_GENERATOR_CHOICE` choices that depend on `TEST_RANDOM_GENERATOR` (i.e. only `TIMER_RANDOM_GENERATOR` as of now). This commit updates the `TEST_RANDOM_GENERATOR` Kconfig symbol description to reflect and clarify that. It also removes the `TEST_RANDOM_GENERATOR`'s dependency on `ENTROPY_HAS_DRIVER` because the act of _allowing_ a non-random number generator to be used does not depend on the availability of an entropy driver -- when an entropy driver is available, by default, the `ENTROPY_DEVICE_RANDOM_GENERATOR` will be selected; otherwise, `TIMER_RANDOM_GENERATOR`, a non-random generator, will be selected. Signed-off-by: Stephanos Ioannidis <stephanos.ioannidis@nordicsemi.no>
This commit is contained in:
parent
de1bd1fa04
commit
6f91f97939
2 changed files with 22 additions and 8 deletions
|
@ -31,8 +31,8 @@ Kconfig Options
|
||||||
These options can be found in the following path :zephyr_file:`subsys/random/Kconfig`.
|
These options can be found in the following path :zephyr_file:`subsys/random/Kconfig`.
|
||||||
|
|
||||||
:kconfig:option:`CONFIG_TEST_RANDOM_GENERATOR`
|
:kconfig:option:`CONFIG_TEST_RANDOM_GENERATOR`
|
||||||
For testing, this option permits random number APIs to return values
|
For testing, this option allows a non-random number generator to be used and
|
||||||
that are not truly random.
|
permits random number APIs to return values that are not truly random.
|
||||||
|
|
||||||
The random number generator choice group allows selection of the RNG
|
The random number generator choice group allows selection of the RNG
|
||||||
source function for the system via the RNG_GENERATOR_CHOICE choice group.
|
source function for the system via the RNG_GENERATOR_CHOICE choice group.
|
||||||
|
|
|
@ -6,18 +6,32 @@
|
||||||
menu "Random Number Generators"
|
menu "Random Number Generators"
|
||||||
|
|
||||||
config TEST_RANDOM_GENERATOR
|
config TEST_RANDOM_GENERATOR
|
||||||
bool "Non-random number generator"
|
bool "Allow non-random number generator"
|
||||||
depends on !ENTROPY_HAS_DRIVER
|
|
||||||
help
|
help
|
||||||
This option signifies that the kernel's random number APIs are
|
This option signifies that a non-random number generator is allowed to
|
||||||
permitted to return values that are not truly random.
|
be used and the kernel's random number APIs are permitted to return
|
||||||
This capability is provided for testing purposes, when a truly random
|
values that are not truly random.
|
||||||
|
|
||||||
|
This capability is provided for testing purposes when a truly random
|
||||||
number generator is not available. The non-random number generator
|
number generator is not available. The non-random number generator
|
||||||
should not be used in a production environment.
|
should not be used in a production environment.
|
||||||
|
|
||||||
|
This option is intended to be selected only by application-level
|
||||||
|
configurations (e.g. in tests and samples) to indicate that the
|
||||||
|
application is allowed to run with a random number generator that is not
|
||||||
|
truly random. Board-level configurations must not select this option
|
||||||
|
unless the sole purpose of the board is testing (e.g. QEMU emulation
|
||||||
|
boards).
|
||||||
|
|
||||||
|
Note that this option does not imply that a non-random number generator
|
||||||
|
is selected -- that is indicated by RNG_GENERATOR_CHOICE. An entropy
|
||||||
|
device-backed random number generator, if available, will be selected by
|
||||||
|
default even when CONFIG_TEST_RANDOM_GENERATOR=y.
|
||||||
|
|
||||||
choice RNG_GENERATOR_CHOICE
|
choice RNG_GENERATOR_CHOICE
|
||||||
prompt "Random generator"
|
prompt "Random generator"
|
||||||
default ENTROPY_DEVICE_RANDOM_GENERATOR
|
default ENTROPY_DEVICE_RANDOM_GENERATOR if ENTROPY_HAS_DRIVER
|
||||||
|
default TIMER_RANDOM_GENERATOR if TEST_RANDOM_GENERATOR
|
||||||
depends on ENTROPY_HAS_DRIVER || TEST_RANDOM_GENERATOR
|
depends on ENTROPY_HAS_DRIVER || TEST_RANDOM_GENERATOR
|
||||||
help
|
help
|
||||||
Platform dependent non-cryptographically secure random number support.
|
Platform dependent non-cryptographically secure random number support.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue