Please sign in to comment.
kvm tools: use /dev/random in virtio-rng
hpa explained it way better than I ever could: On 11/15/2012 04:13 PM, H. Peter Anvin wrote: >> In tools/kvm, you are currently using /dev/urandom as a source for >> virtio-rng. virtio-rng is expected to provide entropic content, as >> the PRNG side of the force can be run in the guest itself. On 11/15/2012 01:49 PM, Sasha Levin wrote: > I was under the impression that by supplying /dev/urandom from the > host, which is *outside* the guest, this is equivalent to completely > random data for the guest since the guest cannot possibly calculate > the random data by observing it's own actions. > > I guess I was wrong on that? If so I'll fix it as you've suggested. It is unpredictable, but not entropic. Those are different things. Consider a PRNG built by AES-encrypting a counter with a random key (the seed). If it is properly randomly seeded, the first 16 bytes would be entropic. However, the second 16 bytes would be completely determined by the first ones and thus add no entropy, even though to be able to predict them you would have to invert AES via a known-plaintext attack. That is why they are different metrics. We already have a PRNG in guest space, so there is no reason to burn more CPU time running one in host space to fake-seed the one in guest space. Suggested-by: H. Peter Anvin <firstname.lastname@example.org> Signed-off-by: Sasha Levin <email@example.com> Signed-off-by: Pekka Enberg <firstname.lastname@example.org>
- Loading branch information...