Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prng: how to seed the random number generator? #5150

Open
OlegHahm opened this issue Mar 23, 2016 · 13 comments
Open

prng: how to seed the random number generator? #5150

OlegHahm opened this issue Mar 23, 2016 · 13 comments
Assignees
Labels
Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR State: don't stale State: Tell state-bot to ignore this issue

Comments

@OlegHahm
Copy link
Member

As @haukepetersen stated in today's meeting, this problem is two-fold:

  1. How to multiplex the PRNG initialization for different sources for the source (and boards without a hardware PRNG)?
  2. How to generate a source for randomness for boards without a hardware PRNG

(edit: the hardware RNG isn't "pseudo-" ;-) /martine)?

@OlegHahm OlegHahm added the Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR label Mar 23, 2016
@miri64
Copy link
Member

miri64 commented Mar 23, 2016

I implemented something like that a while back and opened a PR for it now: #5153.

@miri64
Copy link
Member

miri64 commented Mar 23, 2016

(it offers a solution for both problem parameters).

@miri64
Copy link
Member

miri64 commented Mar 23, 2016

Fixed issue description.

@miri64
Copy link
Member

miri64 commented Mar 23, 2016

A value read with DEV_RANDOM_READ can then be used to initialize the random number generator in auto_init or somewhere like that.

@kaspar030
Copy link
Contributor

There's also #4294. It can use drift between two crystals when there are no "natural" random sources.

@miri64
Copy link
Member

miri64 commented Mar 23, 2016

We could include that into #5153. I still have a bad feeling about your spiking of the PNRG there.

@kaspar030
Copy link
Contributor

Spiking?

@miri64
Copy link
Member

miri64 commented Mar 23, 2016

@jnohlgard
Copy link
Member

@kYc0o kYc0o mentioned this issue Oct 29, 2017
9 tasks
@stale
Copy link

stale bot commented Aug 10, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions.

@stale stale bot added the State: stale State: The issue / PR has no activity for >185 days label Aug 10, 2019
@PeterKietzmann PeterKietzmann added the State: don't stale State: Tell state-bot to ignore this issue label Aug 19, 2019
@stale stale bot removed the State: stale State: The issue / PR has no activity for >185 days label Aug 19, 2019
@MrKevinWeiss MrKevinWeiss added this to the Release 2021.07 milestone Jun 22, 2021
@MrKevinWeiss MrKevinWeiss removed this from the Release 2021.07 milestone Jul 15, 2021
@maribu
Copy link
Member

maribu commented Sep 16, 2022

@Einhornhool could maybe take a look at this. Out of my had I would say: Use puf_sram or a true hardware RNG.

@Einhornhool
Copy link
Contributor

For multiplexing different sources, the mbedTLS entropy module could be an option (#15671).
As a source of randomness on boards without a HWRNG, puf_sram can be used (like @maribu said).

@maribu
Copy link
Member

maribu commented Sep 19, 2022

Looking in the code (auto_init_random() in sys/random/random.c), puf_sram or a hardware RNG are already used to seed the PRNG, when available. The fallback is to used luid_get() (which would at least result in different boards using different seeds) or a default constant.

I guess this means we should make try to get puf_sram supported for all boards and everything will be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion: RFC The issue/PR is used as a discussion starting point about the item of the issue/PR State: don't stale State: Tell state-bot to ignore this issue
Projects
None yet
Development

No branches or pull requests

8 participants