Re: [PATCH v3] random: handle archrandom with multiple longs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Jul 25, 2022 at 11:36 AM David Laight <David.Laight@xxxxxxxxxx> wrote:
>
> ...
> > 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?

Does the above code do that?



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux