lkml.org 
[lkml]   [2022]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v3] random: handle archrandom with multiple longs
Date
...
> More directly, the reason we don't want to error is because the use case
> has fallbacks meant to handle errors. The cascade looks like this
> (quoting from the other email):
>
> unsigned long array[whatever];
> for (i = 0; i < ARRAY_SIZE(array);) {
> longs = arch_get_random_seed_longs(&array[i], ARRAY_SIZE(array) - i);
> if (longs) {
> i += longs;
> continue;
> }
> longs = arch_get_random_longs(&array[i], ARRAY_SIZE(array) - i);
> if (longs) {
> i += longs;
> continue;
> }
> array[i++] = random_get_entropy();
> }
>
> It tries to get the best that it can as much as it can, but isn't going
> to block or do anything too nuts for that.

Do you really want to retry the earlier calls that returned no data?

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
\
 
 \ /
  Last update: 2022-07-25 11:37    [W:1.823 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site