Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-30 Thread Herbert Xu
On Fri, Jun 29, 2018 at 02:07:32PM +0530, Vinod wrote: > > I think Stan did bring this point earlier that PRNG is compliant to > FIPS-140-2. So it can be used by rng clients for various purposes but > should not be fed to dev/random as the hw_random does. > > Herbert, can you please confirm.. Yes

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-29 Thread Vinod
On 28-06-18, 17:04, Timur Tabi wrote: > On Thu, Jun 21, 2018 at 6:53 AM, Herbert Xu > wrote: > > On Thu, Jun 21, 2018 at 02:27:10PM +0300, Stanimir Varbanov wrote: > > > So does it generate one bit of output for each bit of hardware- > > generated entropy like /dev/random? Or does it use a hardw

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-28 Thread Timur Tabi
On Thu, Jun 21, 2018 at 6:53 AM, Herbert Xu wrote: > On Thu, Jun 21, 2018 at 02:27:10PM +0300, Stanimir Varbanov wrote: > So does it generate one bit of output for each bit of hardware- > generated entropy like /dev/random? Or does it use a hardware- > generated seed to power a PRNG? I have some

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-27 Thread Stephan Mueller
Am Mittwoch, 27. Juni 2018, 09:01:44 CEST schrieb Vinod: Hi Vinod, > > > Currently am doing bunch of initialization in .probe (platform driver) > > > and I think recommendation would be to move that to .cra_init, which > > > seem > > > plausible but I don't have pdev to read hw_resource etc.. so

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-27 Thread Vinod
Hi Stephan, Thanks for quick reply, On 27-06-18, 08:43, Stephan Mueller wrote: > > On 27-06-18, 08:13, Stephan Mueller wrote: > > > The key is: > > > alg->base.cra_ctxsize = sizeof(struct drbg_state); > > > > > > during initialization since the kernel crypto API allocates that buffer >

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-26 Thread Stephan Mueller
Am Mittwoch, 27. Juni 2018, 08:27:01 CEST schrieb Vinod: Hi Vinod, > Hi Stephan, > > Thanks for the answers, they are helpful. > > On 27-06-18, 08:13, Stephan Mueller wrote: > > > I have two follow up question on crypto: > > > - If there a way to avoid using a global variable in driver to hold

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-26 Thread Vinod
Hi Stephan, Thanks for the answers, they are helpful. On 27-06-18, 08:13, Stephan Mueller wrote: > > I have two follow up question on crypto: > > > > - If there a way to avoid using a global variable in driver to hold the > >pointer for driver memory? Looks like exynos driver does that. > >

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-26 Thread Stephan Mueller
Am Mittwoch, 27. Juni 2018, 07:08:53 CEST schrieb Vinod: Hi Vinod, > Thanks for the pointers, it helped me to test the driver :) > > I have two follow up question on crypto: > > - If there a way to avoid using a global variable in driver to hold the >pointer for driver memory? Looks like e

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-26 Thread Vinod
On 22-06-18, 19:57, Stephan Mueller wrote: > Hi > > > > Am 22.06.2018 um 16:50 schrieb Herbert Xu : > > > >> On Fri, Jun 22, 2018 at 08:18:09PM +0530, Vinod wrote: > >> > >> Okay I am doing the port taking the exynos-rng as a ref. > >> Question is how to test it, how is one supposed to exercise

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-22 Thread Stanimir Varbanov
Hi, On 06/22/2018 05:38 PM, Herbert Xu wrote: > On Fri, Jun 22, 2018 at 11:27:59AM +0300, Stanimir Varbanov wrote: >> Hi Herbert, >> >> On 06/21/2018 02:53 PM, Herbert Xu wrote: >>> On Thu, Jun 21, 2018 at 02:27:10PM +0300, Stanimir Varbanov wrote: OK, I just wanted to say that it is _no

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-22 Thread Herbert Xu
On Fri, Jun 22, 2018 at 08:18:09PM +0530, Vinod wrote: > > Okay I am doing the port taking the exynos-rng as a ref. > Question is how to test it, how is one supposed to exercise the rng, any > test utils/apps for that? Sorry for noob question, new to crypto > interfaces. algif_rng is available thr

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-22 Thread Vinod
On 22-06-18, 22:38, Herbert Xu wrote: > On Fri, Jun 22, 2018 at 11:27:59AM +0300, Stanimir Varbanov wrote: > > Hi Herbert, > > > > On 06/21/2018 02:53 PM, Herbert Xu wrote: > > > On Thu, Jun 21, 2018 at 02:27:10PM +0300, Stanimir Varbanov wrote: > > >> > > >> OK, I just wanted to say that it is _n

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-22 Thread Herbert Xu
On Fri, Jun 22, 2018 at 11:27:59AM +0300, Stanimir Varbanov wrote: > Hi Herbert, > > On 06/21/2018 02:53 PM, Herbert Xu wrote: > > On Thu, Jun 21, 2018 at 02:27:10PM +0300, Stanimir Varbanov wrote: > >> > >> OK, I just wanted to say that it is _not_ PRNG and the register names > >> gives us wrong

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-22 Thread Stanimir Varbanov
Hi Herbert, On 06/21/2018 02:53 PM, Herbert Xu wrote: > On Thu, Jun 21, 2018 at 02:27:10PM +0300, Stanimir Varbanov wrote: >> >> OK, I just wanted to say that it is _not_ PRNG and the register names >> gives us wrong impression. > > So does it generate one bit of output for each bit of hardware-

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-21 Thread Herbert Xu
On Thu, Jun 21, 2018 at 02:27:10PM +0300, Stanimir Varbanov wrote: > > OK, I just wanted to say that it is _not_ PRNG and the register names > gives us wrong impression. So does it generate one bit of output for each bit of hardware- generated entropy like /dev/random? Or does it use a hardware- g

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-21 Thread Stanimir Varbanov
Hi Herbert, On 06/21/2018 01:15 PM, Herbert Xu wrote: > On Thu, Jun 21, 2018 at 12:56:34PM +0300, Stanimir Varbanov wrote: >> >>> Is this really a pseudo-RNG? If so it needs to be moved over to >>> the algif_rng interface. >> >> Despite the register name (PRNG_ registers prefix) the IP is using FI

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-21 Thread Herbert Xu
On Thu, Jun 21, 2018 at 12:56:34PM +0300, Stanimir Varbanov wrote: > > > Is this really a pseudo-RNG? If so it needs to be moved over to > > the algif_rng interface. > > Despite the register name (PRNG_ registers prefix) the IP is using FIPS > approved algorithm and we can claim that this is true

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-21 Thread Stanimir Varbanov
Hi Herbert, On 06/19/2018 05:28 PM, Herbert Xu wrote: > On Mon, Jun 18, 2018 at 07:42:59PM +0530, Vinod Koul wrote: >> Qcom 8996 and later chips support prng v2 where we need to only >> implement .read callback for hwrng. >> >> Add a new table for v2 which supports this and get version required fo

Re: [PATCH 3/3] hwrng: msm - Add support for prng v2

2018-06-20 Thread Vinod
Hi PrasannaKumar, On 20-06-18, 23:15, PrasannaKumar Muralidharan wrote: > Hi Vinod, > > On 20 June 2018 at 11:02, Vinod wrote: > > On 19-06-18, 22:28, Herbert Xu wrote: > >> On Mon, Jun 18, 2018 at 07:42:59PM +0530, Vinod Koul wrote: > >> > Qcom 8996 and later chips support prng v2 where we need