linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: smueller@chronox.de (Stephan Müller)
To: linux-arm-kernel@lists.infradead.org
Subject: Question - seeding the hw pseudo random number generator
Date: Thu, 23 Mar 2017 12:44:57 +0100	[thread overview]
Message-ID: <6726036.ieol9yEJdI@positron.chronox.de> (raw)
In-Reply-To: <20170323094406.GA6848@gondor.apana.org.au>

Am Donnerstag, 23. M?rz 2017, 10:44:06 CET schrieb Herbert Xu:

Hi Herbert,

> On Thu, Mar 23, 2017 at 09:23:07AM +0100, Corentin Labbe wrote:
> > Problem with this conversion, a huge regression for user space.
> > Using hwrng is simple as cat /dev/hwrng.
> > Using algif_rng via AF_ALG is ... unusable for the moment.
> > Perhaps creating an user space tool (prng-tool which provide a cat
> > /dev/hwrng replacement) is mandatory before any convertion.
> Stephan may have a tool to do this.  Stephan?

Creating such tool is more or less trivial. It simply requires the invocation 
of kcapi_rng_init, kcapi_rng_seed, kcapi_rng_generate and eventually 
kcapi_rng_destroy from [1]. I can write such a tool if requested.

I see one change we need to add to algif_rng.c: currently the caller must 
provide the specific name of the DRNG to be used. With such a tool, the caller 
does not care about the type of DRNG. Thus, rng_bind should be changed such 
that if name is NULL, it should use crypto_get_default_rng(). This would 
alleviate the caller from selecting "the right" DRNG.

[1] http://www.chronox.de/libkcapi.html

Ciao
Stephan

  reply	other threads:[~2017-03-23 11:44 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-18  9:25 Question - seeding the hw pseudo random number generator Krzysztof Kozlowski
2017-03-20  6:49 ` PrasannaKumar Muralidharan
2017-03-20 13:28   ` Herbert Xu
2017-03-20 13:39     ` Stephan Müller
2017-03-23  8:03       ` Harald Freudenberger
2017-03-23 11:35         ` Stephan Müller
2017-03-20 18:24     ` Krzysztof Kozlowski
2017-03-23  8:23     ` Corentin Labbe
2017-03-23  9:44       ` Herbert Xu
2017-03-23 11:44         ` Stephan Müller [this message]
2017-03-23 13:06         ` Stephan Müller
2017-03-26  4:10         ` Stephan Müller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6726036.ieol9yEJdI@positron.chronox.de \
    --to=smueller@chronox.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).