Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1503035

Re: [PATCH] crypto: sun4i-ss: support the Security System PRNG

From Stephan Mueller <smueller@chronox.de>
Newsgroups linux.kernel
Subject Re: [PATCH] crypto: sun4i-ss: support the Security System PRNG
Date 2016-10-18 16:30 +0200
Message-ID <stDyX-2Sj-47@gated-at.bofh.it> (permalink)
References <stBQt-1EF-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Am Dienstag, 18. Oktober 2016, 14:34:27 CEST schrieb Corentin Labbe:

Hi Corentin,

> diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-hwrng.c
> b/drivers/crypto/sunxi-ss/sun4i-ss-hwrng.c new file mode 100644
> index 0000000..95fadb7
> --- /dev/null
> +++ b/drivers/crypto/sunxi-ss/sun4i-ss-hwrng.c
> @@ -0,0 +1,70 @@
> +#include "sun4i-ss.h"
> +
> +static int sun4i_ss_hwrng_init(struct hwrng *hwrng)
> +{
> +	struct sun4i_ss_ctx *ss;
> +
> +	ss = container_of(hwrng, struct sun4i_ss_ctx, hwrng);
> +	get_random_bytes(ss->seed, SS_SEED_LEN);

Is it wise to call get_random_bytes once in the init function and never 
thereafter?

This init function may be called during boot time of the kernel at which the 
input_pool may not yet have received sufficient amounts of entropy.

What about registering a callback with add_random_ready_callback and seed 
again when sufficient entropy was collected?


Ciao
Stephan

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] crypto: sun4i-ss: support the Security System PRNG Corentin Labbe <clabbe.montjoie@gmail.com> - 2016-10-18 14:40 +0200
  Re: [PATCH] crypto: sun4i-ss: support the Security System PRNG Stephan Mueller <smueller@chronox.de> - 2016-10-18 16:30 +0200
  Re: [PATCH] crypto: sun4i-ss: support the Security System PRNG PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> - 2016-10-18 18:10 +0200

csiph-web