From: Patrick McHardy <kaber@trash.net>
To: johnpol@2ka.mipt.ru
Cc: Patrick McHardy <kaber@trash.net>, linux-crypto@vger.kernel.org
Subject: [RFC HIFN 00/02]: RNG support
Date: Sat, 17 Nov 2007 20:30:09 +0100 (MET) [thread overview]
Message-ID: <20071117192949.19399.75523.sendpatchset@localhost.localdomain> (raw)
These two patches add support for using the HIFN rng.
The first patch improves the PLL initialization a bit by making the
reference clock configurable and its speed known to the driver, which
is needed to calculate the amount of time to wait between two RNG reads.
Since there is no way to find out the frequency reliably (especially for
the external clock), it adds some sane looking defaults and a module
parameter to override it. Suggestions how to improve this are welcome.
The second patch adds hw_random support. The ugly part is finding out
when to allow reads from the RNG. It currently translates the public
key engine clock cycles to CPU cycles based on a 4GHz CPU and uses
get_cycles(). The problems with this are obvious, it only works on CPUs
that actually have some kind of cycle counter, has problems with
unsynchronized TSCs and the 4GHz assumption is not very nice either,
but I was reluctant to use ktime for this since it seems rather
expensive to call ktime_get once per 4 bytes of random. Suggestion
for improvement of this are also welcome :)
Running rngtest on the random number generator indicates that it works
properly, with an average failure ratio of about 1:1000 at ~2.5mbit.
drivers/crypto/hifn_795x.c | 158 +++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 156 insertions(+), 2 deletions(-)
Patrick McHardy (2):
[HIFN]: Improve PLL initialization
[HIFN]: Add support for using the random number generator
next reply other threads:[~2007-11-17 19:30 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-17 19:30 Patrick McHardy [this message]
2007-11-17 19:30 ` [RFC HIFN 01/02]: Improve PLL initialization Patrick McHardy
2007-11-17 19:30 ` [RFC HIFN 02/02]: Add support for using the random number generator Patrick McHardy
2007-11-17 19:53 ` [RFC HIFN 00/02]: RNG support Evgeniy Polyakov
2007-11-17 20:04 ` Patrick McHardy
2007-11-18 3:14 ` Herbert Xu
2007-11-18 3:30 ` Patrick McHardy
2007-11-18 4:04 ` Herbert Xu
2007-11-18 4:04 ` Herbert Xu
2007-11-18 10:27 ` Michael Buesch
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=20071117192949.19399.75523.sendpatchset@localhost.localdomain \
--to=kaber@trash.net \
--cc=johnpol@2ka.mipt.ru \
--cc=linux-crypto@vger.kernel.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