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


Groups > linux.kernel > #1609362

Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver

From Stephan Müller <smueller@chronox.de>
Newsgroups linux.kernel
Subject Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver
Date 2017-03-26 19:20 +0200
Message-ID <tpjZE-34q-19@gated-at.bofh.it> (permalink)
References <toWJH-3l4-3@gated-at.bofh.it> <toWJI-3l4-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Am Samstag, 25. März 2017, 17:26:52 CEST schrieb Krzysztof Kozlowski:

Hi Krzysztof,

> +static int exynos_rng_set_seed(struct exynos_rng_dev *rng,
> +			       const u8 *seed, unsigned int slen)
> +{
> +	u32 val;
> +	int i;
> +
> +	dev_dbg(rng->dev, "Seeding with %u bytes\n", slen);
> +
> +	if (slen < EXYNOS_RNG_SEED_SIZE) {
> +		dev_warn(rng->dev, "Seed too short (only %u bytes)\n", slen);
> +		return -EINVAL;
> +	}
> +
> +	for (i = 0 ; i < EXYNOS_RNG_SEED_REGS ; i++) {
> +		val = seed[i * 4] << 24;
> +		val |= seed[i * 4 + 1] << 16;
> +		val |= seed[i * 4 + 2] << 8;
> +		val |= seed[i * 4 + 3] << 0;
> +
> +		exynos_rng_writel(rng, val, EXYNOS_RNG_SEED(i));
> +	}

Would it make sense to add another outer loop here to allow all of slen to be 
injected into the DRNG? Note, in some cases, a user wants to add more seed 
into the DRNG than the actual seed size. In this case, the DRNG acts as a 
compression operation of entropy. This is used when the entropy-to-data ratio 
is not 1:1. In a lot of cases, users have a seed which has less entropy in 
bits per data bit.

Ciao
Stephan

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


Thread

[PATCH v3 0/3] crypto: hw_random - Add new Exynos RNG driver Krzysztof Kozlowski <krzk@kernel.org> - 2017-03-25 17:30 +0100
  [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver Krzysztof Kozlowski <krzk@kernel.org> - 2017-03-25 17:30 +0100
    Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> - 2017-03-26 17:40 +0200
      Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver Krzysztof Kozlowski <krzk@kernel.org> - 2017-03-26 18:10 +0200
        Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver Stephan Müller <smueller@chronox.de> - 2017-03-26 18:20 +0200
        Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> - 2017-03-26 18:50 +0200
          Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver Stephan Müller <smueller@chronox.de> - 2017-03-26 19:10 +0200
            Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver Krzysztof Kozlowski <krzk@kernel.org> - 2017-03-26 20:20 +0200
    Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver Stephan Müller <smueller@chronox.de> - 2017-03-26 19:20 +0200
      Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver Krzysztof Kozlowski <krzk@kernel.org> - 2017-03-26 20:10 +0200
        Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver Stephan Müller <smueller@chronox.de> - 2017-03-26 23:30 +0200
          Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> - 2017-03-27 06:30 +0200
            Re: [PATCH v3 1/3] crypto: hw_random - Add new Exynos RNG driver Stephan Müller <smueller@chronox.de> - 2017-03-27 16:00 +0200
  Re: [PATCH v3 0/3] crypto: hw_random - Add new Exynos RNG driver Stephan Müller <smueller@chronox.de> - 2017-03-25 17:40 +0100

csiph-web