qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH for-4.1 0/7] Add qemu_getrandom and ARMv8.5-RNG


From: Daniel P . Berrangé
Subject: Re: [Qemu-devel] [PATCH for-4.1 0/7] Add qemu_getrandom and ARMv8.5-RNG
Date: Wed, 13 Mar 2019 17:57:23 +0000
User-agent: Mutt/1.11.3 (2019-02-01)

On Wed, Mar 13, 2019 at 08:25:45AM -0700, Richard Henderson wrote:
> On 3/12/19 11:41 PM, address@hidden wrote:
> > time make address@hidden SHOW_ENV=1 J=14 NETWORK=1
> > === TEST SCRIPT END ===
> > 
> >   CC      hw/acpi/trace.o
> >   CC      hw/alpha/trace.o
> > /tmp/qemu-test/src/util/random.c: In function 'do_jrand48':
> > /tmp/qemu-test/src/util/random.c:41:15: error: implicit declaration of 
> > function 'jrand48'; did you mean 'do_jrand48'? 
> > [-Werror=implicit-function-declaration]
> >          val = jrand48(xsubi);
> 
> Hmm, no jrand48 in mingw.  I assumed it would be there because of POSIX.
> Perhaps I should just bite the bullet and inline my own DRNG...

We already have an internal API for providing strong random bytes in
QEMU qcrypto_random_bytes. It is preferentially backed by gnutls or
gcrypt, but if those aren't built-in it falls back to a platform
native API like /dev/random. I've got a todo item to make that use
getrandom on Linux/BSD when available.

I don't think we should be adding a new APIs for getting random
numbers that aren't backed by the qcrypto_random_bytes.

By all means add wrappers around qcrypto_random_bytes to make it more
convenient to get random numbers with a given data types (int64, int32
etc) though.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]