[riot-notifications] [RIOT-OS/RIOT] sys/{crypto, hashes, random}: add modules to Kconfig (#15817)

Leandro Lanzieri notifications at github.com
Thu Jan 21 10:57:02 CET 2021


@leandrolanzieri commented on this pull request.



> @@ -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

> I'm under the impression this dependency is incorrectly modeled in master though

Right, I just check the code and LUID is used only for the auto init.

> Also wouldn't this be better modeled with a choice?

It would be good if the user can select the seed source explicitly. So something like

```
choice
    bool "Seed source"
    depends on MODULE_AUTO_INIT

config MODULE_RANDOM_SEED_SOURCE_PUF
    bool "PUF-SRAM"
    depends on MODULE_PUF_SRAM

config MODULE_RANDOM_SEED_SOURCE_PERIPH_HWRNG
    bool "Hardware RNG"
    depends on HAS_PERIPH_HWRNG
    select MODULE_PERIPH_HWRNG

config MODULE_RANDOM_SEED_SOURCE_PERIPH_CPUID
    bool "CPU ID"
    select MODULE_LUID

config MODULE_RANDOM_SEED_SOURCE_DEFAULT
    bool "Default Seed"

endchoice
```

Should I make the changes in random (only makefile + code) on a separate PR?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/15817#discussion_r561741972
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210121/608ff78b/attachment.htm>


More information about the notifications mailing list