diff --git a/sys/Kconfig b/sys/Kconfig index dac65819ec..3a6991737d 100644 --- a/sys/Kconfig +++ b/sys/Kconfig @@ -30,6 +30,7 @@ rsource "od/Kconfig" rsource "phydat/Kconfig" rsource "pm_layered/Kconfig" rsource "ps/Kconfig" +rsource "random/Kconfig" rsource "saul_reg/Kconfig" rsource "schedstatistics/Kconfig" rsource "shell/Kconfig" diff --git a/sys/random/Kconfig b/sys/random/Kconfig new file mode 100644 index 0000000000..f8820851ad --- /dev/null +++ b/sys/random/Kconfig @@ -0,0 +1,82 @@ +# Copyright (c) 2021 HAW Hamburg +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +menuconfig MODULE_RANDOM + bool "Pseudo-Random Number Generation" + depends on TEST_KCONFIG + select MODULE_LUID + select MODULE_PERIPH_HWRNG if HAS_PERIPH_HWRNG && !MODULE_PUF_SRAM + +if MODULE_RANDOM + +choice RANDOM_IMPLEMENTATION + bool "PRNG Implementation" + depends on TEST_KCONFIG + default MODULE_PRNG_HWRNG if HAS_PERIPH_HWRNG + default MODULE_PRNG_TINYM32 + +config MODULE_PRNG_FORTUNA + bool "Fortuna" + select MODULE_HASHES + select MODULE_XTIMER + select MODULE_FORTUNA + select MODULE_CRYPTO + depends on MODULE_CRYPTO_AES + +config MODULE_PRNG_HWRNG + bool "Hardware RNG" + depends on HAS_PERIPH_HWRNG + select MODULE_PERIPH_HWRNG + +config MODULE_PRNG_MARSENNE + bool "Marsenne" + +config MODULE_PRNG_MINISTD + bool "Mini STD" + +config MODULE_PRNG_MUSL_LCG + bool "MUSL LCG" + +config MODULE_PRNG_SHA1PRNG + bool "SHA-1" + select MODULE_PRNG_SHAXPRNG + select MODULE_HASHES + +config MODULE_PRNG_SHA256PRNG + bool "SHA-256" + select MODULE_PRNG_SHAXPRNG + select MODULE_HASHES + +config MODULE_PRNG_TINYM32 + bool "Tiny-MT 32" + select MODULE_TINYMT32 + +config MODULE_PRNG_XORSHIFT + bool "XOR Shift" + +endchoice # RANDOM_IMPLEMENTATION + +config MODULE_AUTO_INIT_RANDOM + bool "Auto-initialize the random subsystem" + default y + depends on MODULE_AUTO_INIT + +config MODULE_PRNG_SHAXPRNG + bool + help + Unified implementation for SHA-256 and SHA-1 PRNG. + +config MODULE_PRNG + bool + default y + help + Basic Pseudo-random number generation module. + +rsource "fortuna/Kconfig" +rsource "tinymt32/Kconfig" + +endif # MODULE_RANDOM diff --git a/sys/random/fortuna/Kconfig b/sys/random/fortuna/Kconfig new file mode 100644 index 0000000000..0cc634e5d8 --- /dev/null +++ b/sys/random/fortuna/Kconfig @@ -0,0 +1,13 @@ +# Copyright (c) 2021 HAW Hamburg +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +config MODULE_FORTUNA + bool + depends on TEST_KCONFIG + help + Fortuna pseudo-random number generation. This is not your general + purpose PRNG: it is hungry for memory. diff --git a/sys/random/tinymt32/Kconfig b/sys/random/tinymt32/Kconfig new file mode 100644 index 0000000000..3f3aec0799 --- /dev/null +++ b/sys/random/tinymt32/Kconfig @@ -0,0 +1,12 @@ +# Copyright (c) 2021 HAW Hamburg +# +# This file is subject to the terms and conditions of the GNU Lesser +# General Public License v2.1. See the file LICENSE in the top level +# directory for more details. +# + +config MODULE_TINYMT32 + bool + depends on TEST_KCONFIG + help + Tiny Mersenne Twister only 127 bit internal state.