mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* hw rng
@ 2011-09-09 13:15 jyothi v
  2011-09-10  1:17 ` Henrique de Moraes Holschuh
  0 siblings, 1 reply; 3+ messages in thread
From: jyothi v @ 2011-09-09 13:15 UTC (permalink / raw)
  To: linux-kernel

Hi,
Linux provides hardware random registry.
I would like to know how is it useful.
Is there any RNG system calls/APIs for generating random numbers at
Linux user space?
If I need random data at user space application, what should I do?

thanks in advance,
jyothi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: hw rng
  2011-09-09 13:15 hw rng jyothi v
@ 2011-09-10  1:17 ` Henrique de Moraes Holschuh
  0 siblings, 0 replies; 3+ messages in thread
From: Henrique de Moraes Holschuh @ 2011-09-10  1:17 UTC (permalink / raw)
  To: jyothi v; +Cc: linux-kernel

On Fri, 09 Sep 2011, jyothi v wrote:
> Linux provides hardware random registry.
> I would like to know how is it useful.

You use something like this:
http://packages.debian.org/search?keywords=rng-tools

to deal with the entropy from the TRNG (/dev/hw_random) and feed it back to
the kernel, so that it becomes available to the rest of the system (the
kernel itself, and any normal randomness users that get it from /dev/random
and /dev/urandom).

Some hardware RNGs don't use /dev/hw_random, and require specific userspace
drivers instead of rng-tools.

> Is there any RNG system calls/APIs for generating random numbers at
> Linux user space?

There are some book-keeping ioctl() for /dev/random, which stuff like
rng-tools needs to use to feed entropy back to the kernel and to gauge the
amount of entropy the kernel has. 

But to _read_ random data, you just do direct reads from /dev/random or
/dev/urandom.

> If I need random data at user space application, what should I do?

Read it from /dev/urandom if your userspace application would rather receive
the output of a kernel-shielded CRNG when system entropy is low instead of
blocking.  Otherwise, read it from /dev/random, which will block when system
entropy is too low to service the read request.

And get something like this if you will need too much high-quality random
data, or will need high-quality random data from a system that doesn't have
much keyboard and disk activity: http://www.entropykey.co.uk/

-- 
  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* hw rng
       [not found]   ` <CAF5Aa4O5SmmjJUviGkPCTH3iGm3kh71X7G2o6ZeTUP3q6aX+qQ@mail.gmail.com>
@ 2011-09-09 11:16     ` jyothi v
  0 siblings, 0 replies; 3+ messages in thread
From: jyothi v @ 2011-09-09 11:16 UTC (permalink / raw)
  To: linux-kernel

Hi,
Linux provides hardware random registry.
I would like to know how is it useful.
Is there any RNG system calls/APIs for generating random numbers at
Linux user space?
If I need random data at user space application, what should I do?

thanks in advance,
jyothi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-09-10  1:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-09 13:15 hw rng jyothi v
2011-09-10  1:17 ` Henrique de Moraes Holschuh
     [not found] <CAF5Aa4Mp9oN-rgSwoXXrV7ymYj0JTMVZhj+emzY9DNoBMEnr=A@mail.gmail.com>
     [not found] ` <CAF5Aa4MfPu2sVTnTh-eeFHScW9ttobVd4_XV6Ygs9asN8yY=bw@mail.gmail.com>
     [not found]   ` <CAF5Aa4O5SmmjJUviGkPCTH3iGm3kh71X7G2o6ZeTUP3q6aX+qQ@mail.gmail.com>
2011-09-09 11:16     ` jyothi v

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®