> -----Original Message-----
> From: lng-odp-boun...@lists.linaro.org [mailto:lng-odp-
> boun...@lists.linaro.org] On Behalf Of ext Taras Kondratiuk
> Sent: Friday, February 27, 2015 2:32 PM
> To: Robbie King (robking); lng-odp@lists.linaro.org
> Subject: Re: [lng-odp] [PATCH] validation: crypto: split crypto and random
> tests
> 
> On 02/26/2015 08:31 PM, Robbie King (robking) wrote:
> > The only nit that I have, and not sure we have any way around it
> > today, is the size of the test buffer being hard coded to "32".
> > Seems eventually that should be a #define for a given implementation's
> > capabilities, or perhaps a minimum guaranteed on all ODP platforms.
> 
> I can't find it in ML, but I've raised this issue some time ago.
> If platform's RNG don't have enough random bytes to fill
> odp_random_data() request, then we have at least two options:
> 1. odp_random_data() returns whatever number of bytes are available.
>    It can be even 0 bytes until new random bytes are generated.
>    Application have to repeat odp_random_data() in a loop to fill a
>    whole buffer.
> 2. odp_random_data() can block for some time, while implementation
>    polls RNG to fill a whole requested buffer.
> 
> At that time we agreed that #2 is better.

Current API definition is #1 (changed during Ola's return value harmonization). 
I think it makes sense if/when (new) random data generation may take some time. 
Function can return all data that is available immediately and return. 
Application can decide what to do if there was not enough random data 
available: poll in tight/loose loop, record the state and try again later, fail 
and report an error, ...

-Petri


> 
> _______________________________________________
> lng-odp mailing list
> lng-odp@lists.linaro.org
> http://lists.linaro.org/mailman/listinfo/lng-odp

_______________________________________________
lng-odp mailing list
lng-odp@lists.linaro.org
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to