[riot-notifications] [RIOT-OS/RIOT] random: generate random seed at compile-time (#13255)

benpicco notifications at github.com
Tue May 26 11:16:11 CEST 2020


@benpicco commented on this pull request.



> +ifeq (,$(RIOT_CI_BUILD))
+  # random seed value newly generated on each build
+  RANDOM_SEED := $(shell $(RIOTTOOLS)/randhex/randhex.py 32)

Tbh this feature looks like a huge foot gun.
It will provide randomness during development, but once deployed all boards will behave the same.

If this feature is needed for a manual deployment where each node is flashed with a new build, it could be enabled through a pseudo-module. (But even then it would be much better to store the seed in a separate config region on the flash or EEPROM).

But making it default gives a false sense of randomness.

e.g. a user uses random() to decide when nodes should send something, during development with heterogeneous firmware versions this might work as expected.

When deployed all boards will send at the same time.

Can we instead work on improving the random API?

 - one 'true' random function (can be seeded by `puf_sram`, hwrng, …) that is not stable across reboots
 - instantiate randomness (seeded by CPU_ID or application) that can be used to generate 'stable' (across reboots) IDs or application behavior.



-- 
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/13255#pullrequestreview-418115273
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20200526/e5d4eed5/attachment.htm>


More information about the notifications mailing list