On Tue, Mar 12, 2019 at 11:26:29PM -0700, Richard Henderson wrote:
> Use a better interface for random numbers than rand,
> plus some useless floating point arithmetic.

> -    int i;
> -
> -    srand(time(NULL)+getpid()+getpid()*987654+rand());
> -
> -    for (i = 0 ; i < sizeof(vs->challenge) ; i++)
> -        vs->challenge[i] = (int) (256.0*rand()/(RAND_MAX+1.0));
> +    qemu_getrandom(vs->challenge, sizeof(vs->challenge), false);

Reviewed-by: Gerd Hoffmann <kra...@redhat.com>


Reply via email to